mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
Pending offline delay option
This commit is contained in:
@@ -7085,7 +7085,7 @@ speechSynthesis.getVoices();
|
||||
}
|
||||
// delayed second check to prevent status flapping
|
||||
var date = this.updateFriendInProgress.get(id);
|
||||
if (date && date > Date.now() - 120000) {
|
||||
if (date && date > Date.now() - this.pendingOfflineDelay + 5000) {
|
||||
// check if already waiting
|
||||
if (this.debugFriendState) {
|
||||
console.log(
|
||||
@@ -7111,7 +7111,7 @@ speechSynthesis.getVoices();
|
||||
location,
|
||||
$location_at
|
||||
);
|
||||
}, 110000);
|
||||
}, this.pendingOfflineDelay);
|
||||
} else {
|
||||
ctx.ref = ref;
|
||||
ctx.isVIP = isVIP;
|
||||
@@ -12247,6 +12247,16 @@ speechSynthesis.getVoices();
|
||||
configRepository.getString('VRCX_avatarRemoteDatabaseProviderList')
|
||||
);
|
||||
}
|
||||
$app.data.pendingOfflineDelay = configRepository.getInt(
|
||||
'VRCX_pendingOfflineDelay'
|
||||
);
|
||||
if (!configRepository.getInt('VRCX_pendingOfflineDelay')) {
|
||||
$app.data.pendingOfflineDelay = 110000;
|
||||
configRepository.setInt(
|
||||
'VRCX_pendingOfflineDelay',
|
||||
$app.data.pendingOfflineDelay
|
||||
);
|
||||
}
|
||||
if (configRepository.getString('VRCX_avatarRemoteDatabaseProvider')) {
|
||||
// move existing provider to new list
|
||||
var avatarRemoteDatabaseProvider = configRepository.getString(
|
||||
@@ -12536,7 +12546,7 @@ speechSynthesis.getVoices();
|
||||
}
|
||||
if (!configRepository.getInt('VRCX_maxTableSize')) {
|
||||
$app.data.maxTableSize = 1000;
|
||||
configRepository.getInt('VRCX_maxTableSize', $app.data.maxTableSize);
|
||||
configRepository.setInt('VRCX_maxTableSize', $app.data.maxTableSize);
|
||||
database.setmaxTableSize($app.data.maxTableSize);
|
||||
}
|
||||
if (!configRepository.getString('VRCX_photonLobbyTimeoutThreshold')) {
|
||||
@@ -21888,6 +21898,38 @@ speechSynthesis.getVoices();
|
||||
$app.getLocalWorldFavorites();
|
||||
});
|
||||
|
||||
// pending offline timer
|
||||
|
||||
$app.methods.promptSetPendingOffline = function () {
|
||||
this.$prompt(
|
||||
'Set pending offline delay in seconds (default: 110)',
|
||||
'Pending Offline',
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: 'Save',
|
||||
cancelButtonText: 'Cancel',
|
||||
inputValue: this.pendingOfflineDelay,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: 'Valid number is required',
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue &&
|
||||
!isNaN(instance.inputValue)
|
||||
) {
|
||||
this.pendingOfflineDelay = Math.trunc(
|
||||
Number(instance.inputValue) * 1000
|
||||
);
|
||||
configRepository.setInt(
|
||||
'VRCX_pendingOfflineDelay',
|
||||
this.pendingOfflineDelay
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
$app = new Vue($app);
|
||||
window.$app = $app;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user