diff --git a/html/src/app.js b/html/src/app.js index c7237a8b..7104a278 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -5559,6 +5559,7 @@ import gameLogService from './service/gamelog.js' $app.data.hideDevicesFromFeed = configRepository.getBool('VRCX_hideDevicesFromFeed'); $app.data.overlayNotifications = configRepository.getBool('VRCX_overlayNotifications'); $app.data.minimalFeed = configRepository.getBool('VRCX_minimalFeed'); + $app.data.notificationTimeout = configRepository.getString('VRCX_notificationTimeout'); var saveOpenVROption = function () { configRepository.setBool('openVR', this.openVR); 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 var adjustDialogZ = (el) => { diff --git a/html/src/index.pug b/html/src/index.pug index 00f0a30a..28c96e3f 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -506,12 +506,14 @@ html div(style="font-size:12px;margin-top:5px") span(style="display:inline-block;min-width:150px") Hide Private Worlds 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") span(style="display:inline-block;min-width:150px") Overlay Notifications el-switch(v-model="overlayNotifications") div(style="font-size:12px;margin-top:5px") - span(style="display:inline-block;min-width:150px") Minimal Feed Icons - el-switch(v-model="minimalFeed") + el-button(size="small" icon="el-icon-time" @click="promptNotificationTimeout()") Notification Timeout div(style="margin-top:30px") span(style="font-weight:bold") Window div(style="font-size:12px;margin-top:5px") diff --git a/html/src/vr.js b/html/src/vr.js index 6dd341f4..195a5741 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -643,8 +643,16 @@ import webApiService from './service/webapi.js'; }; $app.methods.updateSharedFeed = async function () { - this.isMinimalFeed = configRepository.getBool('VRCX_minimalFeed'); // 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'); if (feeds === null) { @@ -727,6 +735,7 @@ import webApiService from './service/webapi.js'; new Noty({ type: 'alert', theme: theme, + timeout: notificationTimeout, text: `${noty.data} has joined` }).show(); break; @@ -734,6 +743,7 @@ import webApiService from './service/webapi.js'; new Noty({ type: 'alert', theme: theme, + timeout: notificationTimeout, text: `${noty.data} has left` }).show(); break; @@ -741,6 +751,7 @@ import webApiService from './service/webapi.js'; new Noty({ type: 'alert', theme: theme, + timeout: notificationTimeout, text: `${noty.displayName} has logged in` }).show(); break; @@ -748,6 +759,7 @@ import webApiService from './service/webapi.js'; new Noty({ type: 'alert', theme: theme, + timeout: notificationTimeout, text: `${noty.displayName} has logged out` }).show(); break; @@ -755,6 +767,7 @@ import webApiService from './service/webapi.js'; new Noty({ type: 'alert', theme: theme, + timeout: notificationTimeout, text: `${noty.senderUsername} has invited you to ${noty.details.worldName}` }).show(); break; @@ -762,6 +775,7 @@ import webApiService from './service/webapi.js'; new Noty({ type: 'alert', theme: theme, + timeout: notificationTimeout, text: `${noty.senderUsername} has requested an invite` }).show(); break; @@ -769,6 +783,7 @@ import webApiService from './service/webapi.js'; new Noty({ type: 'alert', theme: theme, + timeout: notificationTimeout, text: `${noty.senderUsername} has sent you a friend request` }).show(); break;