Skip to content

Commit

Permalink
Resolve #10
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaze committed Sep 24, 2020
1 parent d291716 commit 4257d9c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 37 deletions.
2 changes: 1 addition & 1 deletion dev/Model/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class FilterModel extends AbstractModel {
}

setRecipients() {
this.actionValueFourth(AccountStore.accountsEmails().join(', '));
this.actionValueFourth(AccountStore.getEmailAddresses().join(', '));
}

parse(json) {
Expand Down
2 changes: 1 addition & 1 deletion dev/Settings/User/Accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 1 addition & 7 deletions dev/Stores/User/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
7 changes: 2 additions & 5 deletions dev/Stores/User/Folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
Expand Down Expand Up @@ -118,6 +113,8 @@ class FolderUserStore {
(item) => (item ? item.localName() : '')
)
);

this.subscribers();
}

subscribers() {
Expand Down
4 changes: 1 addition & 3 deletions dev/Stores/User/Identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
15 changes: 6 additions & 9 deletions dev/Stores/User/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -171,6 +162,12 @@ class MessageUserStore {
});
return result;
});

this.subscribers();

this.onMessageResponse = this.onMessageResponse.bind(this);

this.purgeMessageBodyCacheThrottle = this.purgeMessageBodyCache.throttle(30000);
}

subscribers() {
Expand Down
8 changes: 2 additions & 6 deletions dev/Stores/User/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ class NotificationUserStore {
};
}

this.computers();

this.initNotificationPlayer();
}

computers() {
this.isDesktopNotificationSupported = ko.computed(
() => DesktopNotification.NotSupported !== this.desktopNotificationPermissions()
);
Expand All @@ -99,6 +93,8 @@ class NotificationUserStore {
DesktopNotification.NotSupported === this.desktopNotificationPermissions() ||
DesktopNotification.Denied === this.desktopNotificationPermissions()
);

this.initNotificationPlayer();
}

initNotificationPlayer() {
Expand Down
7 changes: 2 additions & 5 deletions dev/Stores/User/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4257d9c

Please sign in to comment.