Move addObservablesTo, addComputablesTo & addSubscribablesTo to Common/Utils

This commit is contained in:
djmaze 2021-03-16 10:59:47 +01:00
parent eda0ee695d
commit 4b6f6b1bfc
18 changed files with 55 additions and 46 deletions

View file

@ -1,7 +1,6 @@
import ko from 'ko';
import { Capa } from 'Common/Enums';
import { Settings, SettingsGet } from 'Common/Globals';
import { addObservablesTo, addSubscribablesTo } from 'Common/Utils';
import { AppAdminStore } from 'Stores/Admin/App';
@ -13,7 +12,7 @@ export class SecurityAdminSettings {
constructor() {
this.weakPassword = AppAdminStore.weakPassword;
ko.addObservablesTo(this, {
addObservablesTo(this, {
useLocalProxyForExternalImages: !!SettingsGet('UseLocalProxyForExternalImages'),
verifySslCertificate: !!SettingsGet('VerifySslCertificate'),
@ -38,7 +37,7 @@ export class SecurityAdminSettings {
capaTwoFactorAuthForce: Settings.capa(Capa.TwoFactorForce)
});
ko.addSubscribablesTo(this, {
addSubscribablesTo(this, {
adminPassword: () => {
this.adminPasswordUpdateError(false);
this.adminPasswordUpdateSuccess(false);