mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-06 06:52:20 +08:00
32 lines
1 KiB
JavaScript
32 lines
1 KiB
JavaScript
import ko from 'ko';
|
|
|
|
class ContactUserStore {
|
|
constructor() {
|
|
this.contacts = ko.observableArray([]);
|
|
this.contacts.loading = ko.observable(false).extend({ throttle: 200 });
|
|
this.contacts.importing = ko.observable(false).extend({ throttle: 200 });
|
|
this.contacts.syncing = ko.observable(false).extend({ throttle: 200 });
|
|
this.contacts.exportingVcf = ko.observable(false).extend({ throttle: 200 });
|
|
this.contacts.exportingCsv = ko.observable(false).extend({ throttle: 200 });
|
|
|
|
ko.addObservablesTo(this, {
|
|
allowContactsSync: false,
|
|
enableContactsSync: false,
|
|
contactsSyncUrl: '',
|
|
contactsSyncUser: '',
|
|
contactsSyncPass: ''
|
|
});
|
|
}
|
|
|
|
populate() {
|
|
const settingsGet = rl.settings.get;
|
|
this.allowContactsSync(!!settingsGet('ContactsSyncIsAllowed'));
|
|
this.enableContactsSync(!!settingsGet('EnableContactsSync'));
|
|
|
|
this.contactsSyncUrl(settingsGet('ContactsSyncUrl'));
|
|
this.contactsSyncUser(settingsGet('ContactsSyncUser'));
|
|
this.contactsSyncPass(settingsGet('ContactsSyncPassword'));
|
|
}
|
|
}
|
|
|
|
export default new ContactUserStore();
|