mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 13:53:52 +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.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) => {
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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: `<strong>${noty.data}</strong> has joined`
|
||||
}).show();
|
||||
break;
|
||||
@@ -734,6 +743,7 @@ import webApiService from './service/webapi.js';
|
||||
new Noty({
|
||||
type: 'alert',
|
||||
theme: theme,
|
||||
timeout: notificationTimeout,
|
||||
text: `<strong>${noty.data}</strong> has left`
|
||||
}).show();
|
||||
break;
|
||||
@@ -741,6 +751,7 @@ import webApiService from './service/webapi.js';
|
||||
new Noty({
|
||||
type: 'alert',
|
||||
theme: theme,
|
||||
timeout: notificationTimeout,
|
||||
text: `<strong>${noty.displayName}</strong> has logged in`
|
||||
}).show();
|
||||
break;
|
||||
@@ -748,6 +759,7 @@ import webApiService from './service/webapi.js';
|
||||
new Noty({
|
||||
type: 'alert',
|
||||
theme: theme,
|
||||
timeout: notificationTimeout,
|
||||
text: `<strong>${noty.displayName}</strong> has logged out`
|
||||
}).show();
|
||||
break;
|
||||
@@ -755,6 +767,7 @@ import webApiService from './service/webapi.js';
|
||||
new Noty({
|
||||
type: 'alert',
|
||||
theme: theme,
|
||||
timeout: notificationTimeout,
|
||||
text: `<strong>${noty.senderUsername}</strong> 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: `<strong>${noty.senderUsername}</strong> 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: `<strong>${noty.senderUsername}</strong> has sent you a friend request`
|
||||
}).show();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user