Fix settings users initialization before groups

This commit is contained in:
shamoon 2023-09-21 23:35:40 -07:00
parent 02bf0349ca
commit 54099d8441

View File

@ -346,6 +346,7 @@ export class SettingsComponent
.subscribe({ .subscribe({
next: (r) => { next: (r) => {
this.users = r.results this.users = r.results
this.initialize(false)
}, },
error: (e) => { error: (e) => {
this.toastService.showError($localize`Error retrieving users`, e) this.toastService.showError($localize`Error retrieving users`, e)
@ -382,9 +383,8 @@ export class SettingsComponent
} }
} }
if (this.users && this.groups) { if (this.users) {
this.emptyGroup(this.usersGroup) this.emptyGroup(this.usersGroup)
this.emptyGroup(this.groupsGroup)
for (let user of this.users) { for (let user of this.users) {
storeData.usersGroup[user.id.toString()] = { storeData.usersGroup[user.id.toString()] = {
@ -411,7 +411,9 @@ export class SettingsComponent
}) })
) )
} }
}
if (this.groups) {
this.emptyGroup(this.groupsGroup)
for (let group of this.groups) { for (let group of this.groups) {
storeData.groupsGroup[group.id.toString()] = { storeData.groupsGroup[group.id.toString()] = {
id: group.id, id: group.id,