diff --git a/dev/Model/Filter.js b/dev/Model/Filter.js index 8c8a844f9..381281f6b 100644 --- a/dev/Model/Filter.js +++ b/dev/Model/Filter.js @@ -211,7 +211,7 @@ class FilterModel extends AbstractModel { } setRecipients() { - this.actionValueFourth(AccountStore.accountsEmails().join(', ')); + this.actionValueFourth(AccountStore.getEmailAddresses().join(', ')); } parse(json) { diff --git a/dev/Settings/User/Accounts.js b/dev/Settings/User/Accounts.js index 47c7b24de..7fec7d8ec 100644 --- a/dev/Settings/User/Accounts.js +++ b/dev/Settings/User/Accounts.js @@ -79,7 +79,7 @@ class AccountsUserSettings { } accountsAndIdentitiesAfterMove() { - Remote.accountsAndIdentitiesSortOrder(null, AccountStore.accountsEmails.peek(), IdentityStore.identitiesIDS.peek()); + Remote.accountsAndIdentitiesSortOrder(null, AccountStore.getEmailAddresses(), IdentityStore.getIDS()); } onBuild(oDom) { diff --git a/dev/Stores/User/Account.js b/dev/Stores/User/Account.js index 2fa866680..d70b51776 100644 --- a/dev/Stores/User/Account.js +++ b/dev/Stores/User/Account.js @@ -10,13 +10,7 @@ class AccountUserStore { this.accounts = ko.observableArray([]); this.accounts.loading = ko.observable(false).extend({ throttle: 100 }); - this.computers(); - } - - computers() { - this.accountsEmails = ko.computed( - () => this.accounts().map(item => (item ? item.email : null)).filter(value => !!value) - ); + this.getEmailAddresses = () => this.accounts().map(item => item ? item.email : null).filter(value => !!value); this.accountsUnreadCount = ko.computed(() => 0); // this.accountsUnreadCount = ko.computed(() => { diff --git a/dev/Stores/User/Folder.js b/dev/Stores/User/Folder.js index ffac4b2d3..2331577d6 100644 --- a/dev/Stores/User/Folder.js +++ b/dev/Stores/User/Folder.js @@ -32,11 +32,6 @@ class FolderUserStore { this.sieveAllowFileintoInbox = !!rl.settings.get('SieveAllowFileintoInbox'); - this.computers(); - this.subscribers(); - } - - computers() { this.draftFolderNotEnabled = ko.computed( () => !this.draftFolder() || UNUSED_OPTION_VALUE === this.draftFolder() ); @@ -118,6 +113,8 @@ class FolderUserStore { (item) => (item ? item.localName() : '') ) ); + + this.subscribers(); } subscribers() { diff --git a/dev/Stores/User/Identity.js b/dev/Stores/User/Identity.js index f0457e1be..7fa4ee9f4 100644 --- a/dev/Stores/User/Identity.js +++ b/dev/Stores/User/Identity.js @@ -5,9 +5,7 @@ class IdentityUserStore { this.identities = ko.observableArray([]); this.identities.loading = ko.observable(false).extend({ throttle: 100 }); - this.identitiesIDS = ko.computed( - () => this.identities().map(item => (item ? item.id : null)).filter(value => !!value) - ); + this.getIDS = () => this.identities().map(item => (item ? item.id() : null)).filter(value => null !== value); } } diff --git a/dev/Stores/User/Message.js b/dev/Stores/User/Message.js index 3191ac013..3cdc8be26 100644 --- a/dev/Stores/User/Message.js +++ b/dev/Stores/User/Message.js @@ -95,15 +95,6 @@ class MessageUserStore { this.messagesBodiesDom = ko.observable(null); this.messageActiveDom = ko.observable(null); - this.computers(); - this.subscribers(); - - this.onMessageResponse = this.onMessageResponse.bind(this); - - this.purgeMessageBodyCacheThrottle = this.purgeMessageBodyCache.throttle(30000); - } - - computers() { this.messageLoading = ko.computed(() => this.messageCurrentLoading()); this.messageListEndHash = ko.computed( @@ -171,6 +162,12 @@ class MessageUserStore { }); return result; }); + + this.subscribers(); + + this.onMessageResponse = this.onMessageResponse.bind(this); + + this.purgeMessageBodyCacheThrottle = this.purgeMessageBodyCache.throttle(30000); } subscribers() { diff --git a/dev/Stores/User/Notification.js b/dev/Stores/User/Notification.js index 8a7154f3b..0ee2c90c4 100644 --- a/dev/Stores/User/Notification.js +++ b/dev/Stores/User/Notification.js @@ -84,12 +84,6 @@ class NotificationUserStore { }; } - this.computers(); - - this.initNotificationPlayer(); - } - - computers() { this.isDesktopNotificationSupported = ko.computed( () => DesktopNotification.NotSupported !== this.desktopNotificationPermissions() ); @@ -99,6 +93,8 @@ class NotificationUserStore { DesktopNotification.NotSupported === this.desktopNotificationPermissions() || DesktopNotification.Denied === this.desktopNotificationPermissions() ); + + this.initNotificationPlayer(); } initNotificationPlayer() { diff --git a/dev/Stores/User/Settings.js b/dev/Stores/User/Settings.js index 7ffe2fe10..57f3a8034 100644 --- a/dev/Stores/User/Settings.js +++ b/dev/Stores/User/Settings.js @@ -31,12 +31,9 @@ class SettingsUserStore { this.autoLogout = ko.observable(30); - this.computers(); - this.subscribers(); - } - - computers() { this.usePreviewPane = ko.computed(() => Layout.NoPreview !== this.layout()); + + this.subscribers(); } subscribers() {