2016-08-17 06:01:20 +08:00
|
|
|
import ko from 'ko';
|
2021-03-16 17:59:47 +08:00
|
|
|
import { addObservablesTo } from 'Common/Utils';
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2021-03-11 05:41:35 +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),
|
2015-02-02 04:46:23 +08:00
|
|
|
|
2021-03-11 05:41:35 +08:00
|
|
|
accountsUnreadCount: ko.computed(() => 0),
|
|
|
|
// accountsUnreadCount: ko.computed(() => {
|
|
|
|
// let result = 0;
|
|
|
|
// AccountUserStore.accounts().forEach(item => {
|
|
|
|
// if (item) {
|
|
|
|
// result += item.count();
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// return result;
|
|
|
|
// }),
|
|
|
|
};
|
2016-08-17 06:01:20 +08:00
|
|
|
|
2021-03-16 17:59:47 +08:00
|
|
|
addObservablesTo(AccountUserStore, {
|
2021-03-11 05:41:35 +08:00
|
|
|
email: '',
|
|
|
|
signature: ''
|
|
|
|
});
|