Insure login function execution order

This commit is contained in:
Natsumi
2025-02-04 00:14:27 +13:00
parent 6c411db832
commit 00a8309ece
2 changed files with 24 additions and 16 deletions

View File

@@ -2094,6 +2094,9 @@ export default class extends baseClass {
}
try {
console.log(
`Fetching group with missing roles ${groupId}`
);
const args = await API.getGroup({
groupId,
includeRoles: true
@@ -2109,6 +2112,20 @@ export default class extends baseClass {
}
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) {