mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-29 19:53:47 +02:00
Insure login function execution order
This commit is contained in:
23
src/app.js
23
src/app.js
@@ -2155,8 +2155,10 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
} finally {
|
||||||
this.isNotificationsLoading = false;
|
this.isNotificationsLoading = false;
|
||||||
|
$app.notificationInitStatus = true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @typedef {{
|
/** @typedef {{
|
||||||
@@ -4041,6 +4043,7 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
}
|
}
|
||||||
this.isLoggedIn = false;
|
this.isLoggedIn = false;
|
||||||
$app.friendLogInitStatus = false;
|
$app.friendLogInitStatus = false;
|
||||||
|
$app.notificationInitStatus = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
API.$on('LOGIN', function (args) {
|
API.$on('LOGIN', function (args) {
|
||||||
@@ -5542,6 +5545,7 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
$app.feedTable.data = [];
|
$app.feedTable.data = [];
|
||||||
$app.feedSessionTable = [];
|
$app.feedSessionTable = [];
|
||||||
$app.friendLogInitStatus = false;
|
$app.friendLogInitStatus = false;
|
||||||
|
$app.notificationInitStatus = false;
|
||||||
await database.initUserTables(args.json.id);
|
await database.initUserTables(args.json.id);
|
||||||
$app.$refs.menu.activeIndex = 'feed';
|
$app.$refs.menu.activeIndex = 'feed';
|
||||||
await $app.updateDatabaseVersion();
|
await $app.updateDatabaseVersion();
|
||||||
@@ -5557,7 +5561,6 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
$app.notificationTable.data = await database.getNotifications();
|
$app.notificationTable.data = await database.getNotifications();
|
||||||
this.refreshNotifications();
|
this.refreshNotifications();
|
||||||
$app.loadCurrentUserGroups(args.json.id, args.json?.presence?.groups);
|
$app.loadCurrentUserGroups(args.json.id, args.json?.presence?.groups);
|
||||||
$app.getCurrentUserGroups();
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
await configRepository.getBool(`friendLogInit_${args.json.id}`)
|
await configRepository.getBool(`friendLogInit_${args.json.id}`)
|
||||||
@@ -7359,6 +7362,7 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
});
|
});
|
||||||
|
|
||||||
$app.data.friendLogInitStatus = false;
|
$app.data.friendLogInitStatus = false;
|
||||||
|
$app.data.notificationInitStatus = false;
|
||||||
|
|
||||||
$app.methods.initFriendLog = async function (currentUser) {
|
$app.methods.initFriendLog = async function (currentUser) {
|
||||||
this.refreshFriends(currentUser, true);
|
this.refreshFriends(currentUser, true);
|
||||||
@@ -7805,7 +7809,7 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
) {
|
) {
|
||||||
database.addNotificationToDatabase(ref);
|
database.addNotificationToDatabase(ref);
|
||||||
}
|
}
|
||||||
if ($app.friendLogInitStatus) {
|
if ($app.friendLogInitStatus && $app.notificationInitStatus) {
|
||||||
if (
|
if (
|
||||||
$app.notificationTable.filters[0].value.length === 0 ||
|
$app.notificationTable.filters[0].value.length === 0 ||
|
||||||
$app.notificationTable.filters[0].value.includes(ref.type)
|
$app.notificationTable.filters[0].value.includes(ref.type)
|
||||||
@@ -17832,19 +17836,6 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
this.userDialog.isGroupsLoading = false;
|
this.userDialog.isGroupsLoading = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.getCurrentUserGroups = async function () {
|
|
||||||
var args = await API.getGroups({ userId: API.currentUser.id });
|
|
||||||
API.currentUserGroups.clear();
|
|
||||||
for (var group of args.json) {
|
|
||||||
var ref = API.applyGroup(group);
|
|
||||||
if (!API.currentUserGroups.has(group.id)) {
|
|
||||||
API.currentUserGroups.set(group.id, ref);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await API.getGroupPermissions({ userId: API.currentUser.id });
|
|
||||||
this.saveCurrentUserGroups();
|
|
||||||
};
|
|
||||||
|
|
||||||
$app.data.inGameGroupOrder = [];
|
$app.data.inGameGroupOrder = [];
|
||||||
|
|
||||||
$app.methods.getVRChatRegistryKey = async function (key) {
|
$app.methods.getVRChatRegistryKey = async function (key) {
|
||||||
|
|||||||
@@ -2094,6 +2094,9 @@ export default class extends baseClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
console.log(
|
||||||
|
`Fetching group with missing roles ${groupId}`
|
||||||
|
);
|
||||||
const args = await API.getGroup({
|
const args = await API.getGroup({
|
||||||
groupId,
|
groupId,
|
||||||
includeRoles: true
|
includeRoles: true
|
||||||
@@ -2109,6 +2112,20 @@ export default class extends baseClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.currentUserGroupsInit = true;
|
this.currentUserGroupsInit = true;
|
||||||
|
this.getCurrentUserGroups();
|
||||||
|
},
|
||||||
|
|
||||||
|
async getCurrentUserGroups() {
|
||||||
|
var args = await API.getGroups({ userId: API.currentUser.id });
|
||||||
|
API.currentUserGroups.clear();
|
||||||
|
for (var group of args.json) {
|
||||||
|
var ref = API.applyGroup(group);
|
||||||
|
if (!API.currentUserGroups.has(group.id)) {
|
||||||
|
API.currentUserGroups.set(group.id, ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await API.getGroupPermissions({ userId: API.currentUser.id });
|
||||||
|
this.saveCurrentUserGroups();
|
||||||
},
|
},
|
||||||
|
|
||||||
showGroupDialog(groupId) {
|
showGroupDialog(groupId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user