mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Added test contacts CardDAV settings
This commit is contained in:
parent
2809e75307
commit
3d55bdaf5a
7 changed files with 87 additions and 25 deletions
1
dev/External/ko.js
vendored
1
dev/External/ko.js
vendored
|
|
@ -15,6 +15,7 @@ export const
|
|||
* based solely on the values of other observables in the application
|
||||
*/
|
||||
koComputable = fn => ko.computed(fn, {'pure':true}),
|
||||
// koObservable = value => ko.observable(value),
|
||||
|
||||
addObservablesTo = (target, observables) =>
|
||||
forEachObjectEntry(observables, (key, value) =>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
|||
import { koComputable } from 'External/ko';
|
||||
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import { i18n, translateTrigger } from 'Common/Translator';
|
||||
import { i18n, translateTrigger, getErrorMessage } from 'Common/Translator';
|
||||
import { ContactUserStore } from 'Stores/User/Contact';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
|
@ -15,6 +15,7 @@ export class UserSettingsContacts /*extends AbstractViewSettings*/ {
|
|||
this.syncUrl = ContactUserStore.syncUrl;
|
||||
this.syncUser = ContactUserStore.syncUser;
|
||||
this.syncPass = ContactUserStore.syncPass;
|
||||
this.syncError = ko.observable('');
|
||||
|
||||
this.syncModeOptions = koComputable(() => {
|
||||
translateTrigger();
|
||||
|
|
@ -48,4 +49,15 @@ export class UserSettingsContacts /*extends AbstractViewSettings*/ {
|
|||
})
|
||||
);
|
||||
}
|
||||
|
||||
test() {
|
||||
this.syncError('');
|
||||
Remote.request('TestContactsSyncData', (iError, data) => {
|
||||
iError && this.syncError(data.messageAdditional || data.message || getErrorMessage(iError, data));
|
||||
}, {
|
||||
Url: ContactUserStore.syncUrl(),
|
||||
User: ContactUserStore.syncUser(),
|
||||
Password: ContactUserStore.syncPass()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue