mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 16:56:44 +03:00
12 lines
430 B
JavaScript
12 lines
430 B
JavaScript
import { koArrayWithDestroy, 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;
|
|
});
|