2016-08-17 06:01:20 +08:00
|
|
|
import ko from 'ko';
|
2021-03-10 18:44:48 +08:00
|
|
|
import { SettingsGet } from 'Common/Globals';
|
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 ContactUserStore = ko.observableArray();
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2021-03-11 05:41:35 +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
|
|
|
|
2021-03-16 17:59:47 +08:00
|
|
|
addObservablesTo(ContactUserStore, {
|
2021-03-11 05:41:35 +08:00
|
|
|
allowSync: false,
|
|
|
|
enableSync: false,
|
|
|
|
syncUrl: '',
|
|
|
|
syncUser: '',
|
|
|
|
syncPass: ''
|
|
|
|
});
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2021-03-11 05:41:35 +08:00
|
|
|
ContactUserStore.populate = function() {
|
|
|
|
this.allowSync(!!SettingsGet('ContactsSyncIsAllowed'));
|
|
|
|
this.enableSync(!!SettingsGet('EnableContactsSync'));
|
2016-06-30 08:02:45 +08:00
|
|
|
|
2021-03-11 05:41:35 +08:00
|
|
|
this.syncUrl(SettingsGet('ContactsSyncUrl'));
|
|
|
|
this.syncUser(SettingsGet('ContactsSyncUser'));
|
|
|
|
this.syncPass(SettingsGet('ContactsSyncPassword'));
|
|
|
|
};
|