Cleanup additional accounts in system menu

This commit is contained in:
djmaze 2021-12-02 11:12:21 +01:00
parent 64e77de103
commit 0d809dd574
7 changed files with 25 additions and 44 deletions

View file

@ -419,24 +419,23 @@ class AppUser extends AbstractApp {
IdentityUserStore.loading(false);
if (!iError) {
const counts = {},
const
// counts = {},
accounts = oData.Result.Accounts,
mainEmail = SettingsGet('MainEmail');
if (isArray(accounts)) {
AccountUserStore.accounts.forEach(oAccount =>
counts[oAccount.email] = oAccount.count()
);
// AccountUserStore.accounts.forEach(oAccount => counts[oAccount.email] = oAccount.count());
delegateRunOnDestroy(AccountUserStore.accounts());
AccountUserStore.accounts(
accounts.map(
sValue => new AccountModel(sValue, counts[sValue])
sValue => new AccountModel(sValue/*, counts[sValue]*/)
)
);
// accounts.length &&
AccountUserStore.accounts.unshift(new AccountModel(mainEmail, counts[mainEmail], false));
AccountUserStore.accounts.unshift(new AccountModel(mainEmail/*, counts[mainEmail]*/, false));
}
if (isArray(oData.Result.Identities)) {