mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Replace babel command decorators with proper knockout command decorators
This commit is contained in:
parent
b6d8fa5b3f
commit
540b12ed26
27 changed files with 181 additions and 132 deletions
|
|
@ -4,7 +4,7 @@ import { settingsSaveHelperSimpleFunction, defaultOptionsAfterRender } from 'Com
|
|||
|
||||
import { SaveSettingsStep, StorageResultType } from 'Common/Enums';
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
|
||||
const settingsGet = rl.settings.get;
|
||||
|
||||
|
|
@ -74,9 +74,12 @@ export class ContactsAdminSettings {
|
|||
this.contactsType(settingsGet('ContactsPdoType'));
|
||||
|
||||
this.onTestContactsResponse = this.onTestContactsResponse.bind(this);
|
||||
|
||||
decorateKoCommands(this, {
|
||||
testContactsCommand: self => self.pdoDsn() && self.pdoUser()
|
||||
});
|
||||
}
|
||||
|
||||
@command((self) => self.pdoDsn() && self.pdoUser())
|
||||
testContactsCommand() {
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { CapaAdminStore } from 'Stores/Admin/Capa';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
|
||||
const settingsGet = rl.settings.get;
|
||||
|
||||
|
|
@ -75,9 +75,12 @@ export class SecurityAdminSettings {
|
|||
});
|
||||
|
||||
this.onNewAdminPasswordResponse = this.onNewAdminPasswordResponse.bind(this);
|
||||
|
||||
decorateKoCommands(this, {
|
||||
saveNewAdminPasswordCommand: self => self.adminLogin().trim() && self.adminPassword()
|
||||
});
|
||||
}
|
||||
|
||||
@command((self) => self.adminLogin().trim() && self.adminPassword())
|
||||
saveNewAdminPasswordCommand() {
|
||||
if (!this.adminLogin().trim()) {
|
||||
this.adminLoginError(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue