snappymail/dev/Stores/User/Contact.js

26 lines
784 B
JavaScript
Raw Normal View History

import ko from 'ko';
2021-03-10 18:44:48 +08:00
import { SettingsGet } from 'Common/Globals';
2016-06-30 08:02:45 +08:00
export const ContactUserStore = ko.observableArray();
2016-06-30 08:02:45 +08:00
ContactUserStore.loading = ko.observable(false).extend({ debounce: 200 });
ContactUserStore.importing = ko.observable(false).extend({ debounce: 200 });
ContactUserStore.syncing = ko.observable(false).extend({ debounce: 200 });
2016-06-30 08:02:45 +08:00
ko.addObservablesTo(ContactUserStore, {
allowSync: false,
enableSync: false,
syncUrl: '',
syncUser: '',
syncPass: ''
});
2016-06-30 08:02:45 +08:00
ContactUserStore.populate = function() {
this.allowSync(!!SettingsGet('ContactsSyncIsAllowed'));
this.enableSync(!!SettingsGet('EnableContactsSync'));
2016-06-30 08:02:45 +08:00
this.syncUrl(SettingsGet('ContactsSyncUrl'));
this.syncUser(SettingsGet('ContactsSyncUser'));
this.syncPass(SettingsGet('ContactsSyncPassword'));
};