diff --git a/dev/App/User.js b/dev/App/User.js index a9345dcbf..7b03711a2 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -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)) { diff --git a/dev/Model/Account.js b/dev/Model/Account.js index 02cb46b21..1bf005b41 100644 --- a/dev/Model/Account.js +++ b/dev/Model/Account.js @@ -6,13 +6,13 @@ export class AccountModel extends AbstractModel { * @param {boolean=} canBeDelete = true * @param {number=} count = 0 */ - constructor(email, count = 0, isAdditional = true) { + constructor(email/*, count = 0*/, isAdditional = true) { super(); this.email = email; this.addObservables({ - count: count || 0, +// count: count || 0, deleteAccess: false, isAdditional: isAdditional }); diff --git a/dev/Screen/User/MailBox.js b/dev/Screen/User/MailBox.js index aca291bbf..6f92edf58 100644 --- a/dev/Screen/User/MailBox.js +++ b/dev/Screen/User/MailBox.js @@ -87,12 +87,12 @@ export class MailBoxUserScreen extends AbstractScreen { addEventListener('mailbox.inbox-unread-count', e => { FolderUserStore.foldersInboxUnreadCount(e.detail); - +/* // Disabled in SystemDropDown.html const email = AccountUserStore.email(); AccountUserStore.accounts.forEach(item => item && email === item.email && item.count(e.detail) ); - +*/ this.updateWindowTitle(); }); } diff --git a/dev/Stores/User/Account.js b/dev/Stores/User/Account.js index d54c8005b..fa81a9e25 100644 --- a/dev/Stores/User/Account.js +++ b/dev/Stores/User/Account.js @@ -5,18 +5,7 @@ export const AccountUserStore = { accounts: ko.observableArray(), loading: ko.observable(false).extend({ debounce: 100 }), - getEmailAddresses: () => AccountUserStore.accounts.map(item => item.email), - - accountsUnreadCount: ko.computed(() => 0), - // accountsUnreadCount: ko.computed(() => { - // let result = 0; - // AccountUserStore.accounts().forEach(item => { - // if (item) { - // result += item.count(); - // } - // }); - // return result; - // }), + getEmailAddresses: () => AccountUserStore.accounts.map(item => item.email) }; addObservablesTo(AccountUserStore, { diff --git a/dev/Styles/User/SystemDropDown.less b/dev/Styles/User/SystemDropDown.less index 84f03337f..5f0ff170f 100644 --- a/dev/Styles/User/SystemDropDown.less +++ b/dev/Styles/User/SystemDropDown.less @@ -71,13 +71,6 @@ white-space: nowrap; } - .account-item { - &:not(.current) i:first-child, - &.current i + i { - display: none; - } - } - .counter { display: inline-block; } diff --git a/dev/View/User/SystemDropDown.js b/dev/View/User/SystemDropDown.js index 0ae3c2af1..8e831bfe2 100644 --- a/dev/View/User/SystemDropDown.js +++ b/dev/View/User/SystemDropDown.js @@ -31,7 +31,10 @@ export class SystemDropDownUserView extends AbstractViewRight { this.accounts = AccountUserStore.accounts; this.accountsLoading = AccountUserStore.loading; - this.accountsUnreadCount = AccountUserStore.accountsUnreadCount; +/* + this.accountsUnreadCount = : ko.computed(() => 0); + this.accountsUnreadCount = : ko.computed(() => AccountUserStore.accounts().reduce((result, item) => result + item.count(), 0)); +*/ this.addObservables({ currentAudio: '', diff --git a/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html b/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html index f9ad9098a..10274b40a 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html @@ -17,20 +17,17 @@