mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Preparations for #1689
This commit is contained in:
parent
d2f3aa1c10
commit
166b790a3e
4 changed files with 18 additions and 11 deletions
|
|
@ -1,5 +1,13 @@
|
|||
import { koArrayWithDestroy } from 'External/ko';
|
||||
import { koComputable } from 'External/ko';
|
||||
import { isArray } from 'Common/Utils';
|
||||
|
||||
export const IdentityUserStore = koArrayWithDestroy();
|
||||
|
||||
IdentityUserStore.loading = ko.observable(false).extend({ debounce: 100 });
|
||||
|
||||
/** Returns main (login) identity */
|
||||
IdentityUserStore.main = koComputable(() => {
|
||||
const list = IdentityUserStore();
|
||||
return isArray(list) ? list.find(item => item && !item.id()) : null;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue