mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 11:39:21 +03:00
Cleanup admin code
This commit is contained in:
parent
75c879836c
commit
3572d00a10
16 changed files with 178 additions and 244 deletions
|
|
@ -105,8 +105,6 @@ export class ContactsAdminSettings {
|
|||
})
|
||||
})
|
||||
|
||||
this.onTestContactsResponse = this.onTestContactsResponse.bind(this);
|
||||
|
||||
decorateKoCommands(this, {
|
||||
testContactsCommand: self => self.pdoDsn() && self.pdoUser()
|
||||
});
|
||||
|
|
@ -118,7 +116,24 @@ export class ContactsAdminSettings {
|
|||
this.testContactsErrorMessage('');
|
||||
this.testing(true);
|
||||
|
||||
Remote.testContacts(this.onTestContactsResponse, {
|
||||
Remote.testContacts((iError, data) => {
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
|
||||
if (!iError && data.Result.Result) {
|
||||
this.testContactsSuccess(true);
|
||||
} else {
|
||||
this.testContactsError(true);
|
||||
if (data && data.Result) {
|
||||
this.testContactsErrorMessage(data.Result.Message || '');
|
||||
} else {
|
||||
this.testContactsErrorMessage('');
|
||||
}
|
||||
}
|
||||
|
||||
this.testing(false);
|
||||
}, {
|
||||
ContactsPdoType: this.contactsType(),
|
||||
ContactsPdoDsn: this.pdoDsn(),
|
||||
ContactsPdoUser: this.pdoUser(),
|
||||
|
|
@ -126,25 +141,6 @@ export class ContactsAdminSettings {
|
|||
});
|
||||
}
|
||||
|
||||
onTestContactsResponse(iError, data) {
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
|
||||
if (!iError && data.Result.Result) {
|
||||
this.testContactsSuccess(true);
|
||||
} else {
|
||||
this.testContactsError(true);
|
||||
if (data && data.Result) {
|
||||
this.testContactsErrorMessage(data.Result.Message || '');
|
||||
} else {
|
||||
this.testContactsErrorMessage('');
|
||||
}
|
||||
}
|
||||
|
||||
this.testing(false);
|
||||
}
|
||||
|
||||
onShow() {
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue