mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 06:16:05 +02:00
Changes for getCurrentUser
This commit is contained in:
+22
-11
@@ -5358,6 +5358,14 @@ speechSynthesis.getVoices();
|
|||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.reconnectWebSocket = function () {
|
||||||
|
if (!$app.friendLogInitStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.closeWebSocket();
|
||||||
|
this.getAuth();
|
||||||
|
};
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
// #region | API: Visit
|
// #region | API: Visit
|
||||||
|
|
||||||
@@ -5634,9 +5642,14 @@ speechSynthesis.getVoices();
|
|||||||
throw err;
|
throw err;
|
||||||
})
|
})
|
||||||
.then((args) => {
|
.then((args) => {
|
||||||
API.getCurrentUser().finally(() => {
|
API.getCurrentUser()
|
||||||
this.loginForm.loading = false;
|
.finally(() => {
|
||||||
});
|
this.loginForm.loading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.nextCurrentUserRefresh = 120; // 1min
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -5758,16 +5771,14 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
if (--this.nextCurrentUserRefresh <= 0) {
|
if (--this.nextCurrentUserRefresh <= 0) {
|
||||||
this.nextCurrentUserRefresh = 840; // 7mins
|
this.nextCurrentUserRefresh = 840; // 7mins
|
||||||
API.getCurrentUser().catch((err1) => {
|
API.getCurrentUser();
|
||||||
throw err1;
|
|
||||||
});
|
|
||||||
AppApi.CheckGameRunning();
|
|
||||||
}
|
}
|
||||||
if (--this.nextGroupInstanceRefresh <= 0) {
|
if (--this.nextGroupInstanceRefresh <= 0) {
|
||||||
if (this.friendLogInitStatus) {
|
if (this.friendLogInitStatus) {
|
||||||
this.nextGroupInstanceRefresh = 600; // 5min
|
this.nextGroupInstanceRefresh = 600; // 5min
|
||||||
API.getUsersGroupInstances();
|
API.getUsersGroupInstances();
|
||||||
}
|
}
|
||||||
|
AppApi.CheckGameRunning();
|
||||||
}
|
}
|
||||||
if (--this.nextAppUpdateCheck <= 0) {
|
if (--this.nextAppUpdateCheck <= 0) {
|
||||||
if (this.branch === 'Stable') {
|
if (this.branch === 'Stable') {
|
||||||
@@ -9072,12 +9083,12 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
|
|
||||||
$app.methods.refreshFriendsList = async function () {
|
$app.methods.refreshFriendsList = async function () {
|
||||||
await API.getCurrentUser();
|
await API.getCurrentUser().catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
this.nextCurrentUserRefresh = 840; // 7mins
|
this.nextCurrentUserRefresh = 840; // 7mins
|
||||||
await API.refreshFriends();
|
await API.refreshFriends();
|
||||||
API.closeWebSocket();
|
API.reconnectWebSocket();
|
||||||
await API.getCurrentUser();
|
|
||||||
this.nextCurrentUserRefresh = 840; // 7mins
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.refreshFriends = function (ref, origin) {
|
$app.methods.refreshFriends = function (ref, origin) {
|
||||||
|
|||||||
Reference in New Issue
Block a user