mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
notification timeout setting
This commit is contained in:
@@ -5559,6 +5559,7 @@ import gameLogService from './service/gamelog.js'
|
|||||||
$app.data.hideDevicesFromFeed = configRepository.getBool('VRCX_hideDevicesFromFeed');
|
$app.data.hideDevicesFromFeed = configRepository.getBool('VRCX_hideDevicesFromFeed');
|
||||||
$app.data.overlayNotifications = configRepository.getBool('VRCX_overlayNotifications');
|
$app.data.overlayNotifications = configRepository.getBool('VRCX_overlayNotifications');
|
||||||
$app.data.minimalFeed = configRepository.getBool('VRCX_minimalFeed');
|
$app.data.minimalFeed = configRepository.getBool('VRCX_minimalFeed');
|
||||||
|
$app.data.notificationTimeout = configRepository.getString('VRCX_notificationTimeout');
|
||||||
var saveOpenVROption = function () {
|
var saveOpenVROption = function () {
|
||||||
configRepository.setBool('openVR', this.openVR);
|
configRepository.setBool('openVR', this.openVR);
|
||||||
configRepository.setBool('openVRAlways', this.openVRAlways);
|
configRepository.setBool('openVRAlways', this.openVRAlways);
|
||||||
@@ -5709,6 +5710,25 @@ import gameLogService from './service/gamelog.js'
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.promptNotificationTimeout = function () {
|
||||||
|
this.$prompt('Enter amount of seconds', 'Notification Timeout', {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
inputValue: this.notificationTimeout / 1000,
|
||||||
|
inputPattern: /\d+$/,
|
||||||
|
inputErrorMessage: 'Valid number is required',
|
||||||
|
callback: (action, instance) => {
|
||||||
|
if (action === 'confirm' &&
|
||||||
|
instance.inputValue &&
|
||||||
|
!isNaN(instance.inputValue)) {
|
||||||
|
this.notificationTimeout = Math.trunc(Number(instance.inputValue) * 1000);
|
||||||
|
configRepository.setString('VRCX_notificationTimeout', this.notificationTimeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// App: Dialog
|
// App: Dialog
|
||||||
|
|
||||||
var adjustDialogZ = (el) => {
|
var adjustDialogZ = (el) => {
|
||||||
|
|||||||
+4
-2
@@ -506,12 +506,14 @@ html
|
|||||||
div(style="font-size:12px;margin-top:5px")
|
div(style="font-size:12px;margin-top:5px")
|
||||||
span(style="display:inline-block;min-width:150px") Hide Private Worlds
|
span(style="display:inline-block;min-width:150px") Hide Private Worlds
|
||||||
el-switch(v-model="hidePrivateFromFeed")
|
el-switch(v-model="hidePrivateFromFeed")
|
||||||
|
div(style="font-size:12px;margin-top:5px")
|
||||||
|
span(style="display:inline-block;min-width:150px") Minimal Feed Icons
|
||||||
|
el-switch(v-model="minimalFeed")
|
||||||
div(style="font-size:12px;margin-top:5px")
|
div(style="font-size:12px;margin-top:5px")
|
||||||
span(style="display:inline-block;min-width:150px") Overlay Notifications
|
span(style="display:inline-block;min-width:150px") Overlay Notifications
|
||||||
el-switch(v-model="overlayNotifications")
|
el-switch(v-model="overlayNotifications")
|
||||||
div(style="font-size:12px;margin-top:5px")
|
div(style="font-size:12px;margin-top:5px")
|
||||||
span(style="display:inline-block;min-width:150px") Minimal Feed Icons
|
el-button(size="small" icon="el-icon-time" @click="promptNotificationTimeout()") Notification Timeout
|
||||||
el-switch(v-model="minimalFeed")
|
|
||||||
div(style="margin-top:30px")
|
div(style="margin-top:30px")
|
||||||
span(style="font-weight:bold") Window
|
span(style="font-weight:bold") Window
|
||||||
div(style="font-size:12px;margin-top:5px")
|
div(style="font-size:12px;margin-top:5px")
|
||||||
|
|||||||
+16
-1
@@ -643,8 +643,16 @@ import webApiService from './service/webapi.js';
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.updateSharedFeed = async function () {
|
$app.methods.updateSharedFeed = async function () {
|
||||||
this.isMinimalFeed = configRepository.getBool('VRCX_minimalFeed');
|
|
||||||
// TODO: block mute hideAvatar unfriend
|
// TODO: block mute hideAvatar unfriend
|
||||||
|
this.isMinimalFeed = configRepository.getBool('VRCX_minimalFeed');
|
||||||
|
var notificationTimeout = configRepository.getString('VRCX_notificationTimeout');
|
||||||
|
if (notificationTimeout == '' || isNaN(notificationTimeout)) {
|
||||||
|
notificationTimeout = 3000;
|
||||||
|
}
|
||||||
|
var theme = 'relax';
|
||||||
|
if (configRepository.getBool('isDarkMode') === true) {
|
||||||
|
theme = 'sunset';
|
||||||
|
}
|
||||||
|
|
||||||
var feeds = sharedRepository.getArray('feeds');
|
var feeds = sharedRepository.getArray('feeds');
|
||||||
if (feeds === null) {
|
if (feeds === null) {
|
||||||
@@ -727,6 +735,7 @@ import webApiService from './service/webapi.js';
|
|||||||
new Noty({
|
new Noty({
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
text: `<strong>${noty.data}</strong> has joined`
|
text: `<strong>${noty.data}</strong> has joined`
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
@@ -734,6 +743,7 @@ import webApiService from './service/webapi.js';
|
|||||||
new Noty({
|
new Noty({
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
text: `<strong>${noty.data}</strong> has left`
|
text: `<strong>${noty.data}</strong> has left`
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
@@ -741,6 +751,7 @@ import webApiService from './service/webapi.js';
|
|||||||
new Noty({
|
new Noty({
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
text: `<strong>${noty.displayName}</strong> has logged in`
|
text: `<strong>${noty.displayName}</strong> has logged in`
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
@@ -748,6 +759,7 @@ import webApiService from './service/webapi.js';
|
|||||||
new Noty({
|
new Noty({
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
text: `<strong>${noty.displayName}</strong> has logged out`
|
text: `<strong>${noty.displayName}</strong> has logged out`
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
@@ -755,6 +767,7 @@ import webApiService from './service/webapi.js';
|
|||||||
new Noty({
|
new Noty({
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
text: `<strong>${noty.senderUsername}</strong> has invited you to ${noty.details.worldName}`
|
text: `<strong>${noty.senderUsername}</strong> has invited you to ${noty.details.worldName}`
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
@@ -762,6 +775,7 @@ import webApiService from './service/webapi.js';
|
|||||||
new Noty({
|
new Noty({
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
text: `<strong>${noty.senderUsername}</strong> has requested an invite`
|
text: `<strong>${noty.senderUsername}</strong> has requested an invite`
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
@@ -769,6 +783,7 @@ import webApiService from './service/webapi.js';
|
|||||||
new Noty({
|
new Noty({
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
text: `<strong>${noty.senderUsername}</strong> has sent you a friend request`
|
text: `<strong>${noty.senderUsername}</strong> has sent you a friend request`
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user