Misc fixes

This commit is contained in:
Natsumi
2025-01-20 21:56:33 +13:00
parent 95d5486cdb
commit 555d4adf60
8 changed files with 60 additions and 49 deletions

View File

@@ -8126,7 +8126,7 @@ console.log(`isLinux: ${LINUX}`);
'[ "https://avtr.just-h.party/vrcx_search.php" ]'
)
);
$app.data.pendingOfflineDelay = 130000;
$app.data.pendingOfflineDelay = 180000;
if (await configRepository.getString('VRCX_avatarRemoteDatabaseProvider')) {
// move existing provider to new list
var avatarRemoteDatabaseProvider = await configRepository.getString(
@@ -16769,9 +16769,12 @@ console.log(`isLinux: ${LINUX}`);
$app.methods.getAndDisplayLastScreenshot = function () {
this.screenshotMetadataResetSearch();
AppApi.GetLastScreenshot().then((path) =>
this.getAndDisplayScreenshot(path)
);
AppApi.GetLastScreenshot().then((path) => {
if (!path) {
return;
}
this.getAndDisplayScreenshot(path);
});
};
/**
@@ -17054,6 +17057,9 @@ console.log(`isLinux: ${LINUX}`);
};
$app.methods.copyImageToClipboard = function (path) {
if (!path) {
return;
}
AppApi.CopyImageToClipboard(path).then(() => {
this.$message({
message: 'Image copied to clipboard',
@@ -17063,6 +17069,9 @@ console.log(`isLinux: ${LINUX}`);
};
$app.methods.openImageFolder = function (path) {
if (!path) {
return;
}
AppApi.OpenFolderAndSelectItem(path).then(() => {
this.$message({
message: 'Opened image folder',

View File

@@ -15,6 +15,7 @@ export default class extends baseClass {
async init() {
API.isLoggedIn = false;
API.attemptingAutoLogin = false;
API.autoLoginAttempts = new Set();
/**
* @param {{ username: string, password: string }} params credential to login
@@ -126,9 +127,25 @@ export default class extends baseClass {
return;
}
if ($app.enablePrimaryPassword) {
console.error(
'Primary password is enabled, this disables auto login.'
);
this.attemptingAutoLogin = false;
this.logout();
return;
}
var attemptsInLastHour = Array.from(this.autoLoginAttempts).filter(
(timestamp) => timestamp > new Date().getTime() - 3600000
).length;
if (attemptsInLastHour >= 3) {
console.error(
'More than 3 auto login attempts within the past hour, logging out instead of attempting auto login.'
);
this.attemptingAutoLogin = false;
this.logout();
return;
}
this.autoLoginAttempts.add(new Date().getTime());
$app.relogin(user)
.then(() => {
if (this.errorNoty) {
@@ -167,6 +184,7 @@ export default class extends baseClass {
API.$on('LOGOUT', function () {
this.attemptingAutoLogin = false;
this.autoLoginAttempts.clear();
});
API.logout = function () {

View File

@@ -165,7 +165,8 @@
"unmute": "Unmute",
"interactOn": "Interact On",
"interactOff": "Interact Off",
"muteChat": "Mute chat"
"muteChat": "Mute chat",
"unmuteChat": "Unmute chat"
}
},
"notification": {

View File

@@ -171,7 +171,8 @@
'unmute',
'interactOn',
'interactOff',
'muteChat'
'muteChat',
'unmuteChat'
],
tableProps: {
stripe: true,