mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 15:08:28 +03:00
Added: option to enable additional account unread messages count
This commit is contained in:
parent
bad33e6dc4
commit
215767ed9b
45 changed files with 96 additions and 39 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
import { addObservablesTo } from 'External/ko';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
|
||||
export class AccountModel extends AbstractModel {
|
||||
/**
|
||||
|
|
@ -23,7 +24,8 @@ export class AccountModel extends AbstractModel {
|
|||
});
|
||||
|
||||
// Load at random between 3 and 30 seconds
|
||||
isAdditional && setTimeout(()=>this.fetchUnread(), (Math.ceil(Math.random() * 10)) * 3000);
|
||||
SettingsUserStore.showUnreadCount() && isAdditional
|
||||
&& setTimeout(()=>this.fetchUnread(), (Math.ceil(Math.random() * 10)) * 3000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { SettingsCapa, SettingsGet } from 'Common/Globals';
|
|||
|
||||
import { AccountUserStore } from 'Stores/User/Account';
|
||||
import { IdentityUserStore } from 'Stores/User/Identity';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
|
@ -25,6 +26,9 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
this.accountForDeletion = ko.observable(null).askDeleteHelper();
|
||||
this.identityForDeletion = ko.observable(null).askDeleteHelper();
|
||||
|
||||
this.showUnread = SettingsUserStore.showUnreadCount;
|
||||
SettingsUserStore.showUnreadCount.subscribe(value => Remote.saveSetting('ShowUnreadCount', value));
|
||||
|
||||
// this.additionalAccounts = koComputable(() => AccountUserStore.filter(account => account.isAdditional()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ export const SettingsUserStore = new class {
|
|||
hideDeleted: 1,
|
||||
unhideKolabFolders: 0,
|
||||
autoLogout: 0,
|
||||
showUnreadCount: 0,
|
||||
|
||||
requestReadReceipt: 0,
|
||||
requestDsn: 0,
|
||||
|
|
@ -89,6 +90,7 @@ export const SettingsUserStore = new class {
|
|||
|
||||
self.hideUnsubscribed(SettingsGet('HideUnsubscribed'));
|
||||
self.hideDeleted(SettingsGet('HideDeleted'));
|
||||
self.showUnreadCount(SettingsGet('ShowUnreadCount'));
|
||||
self.unhideKolabFolders(SettingsGet('UnhideKolabFolders'));
|
||||
|
||||
self.requestReadReceipt(SettingsGet('requestReadReceipt'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue