snappymail/dev/Stores/User/Account.js

26 lines
602 B
JavaScript
Raw Normal View History

import ko from 'ko';
import { addObservablesTo } from 'Common/Utils';
2016-06-30 08:02:45 +08:00
export const AccountUserStore = {
accounts: ko.observableArray(),
loading: ko.observable(false).extend({ debounce: 100 }),
2015-02-19 03:52:52 +08:00
2021-11-15 17:56:52 +08:00
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;
// }),
};
addObservablesTo(AccountUserStore, {
email: '',
signature: ''
});