Drop Capa enums

This commit is contained in:
the-djmaze 2022-03-05 22:25:32 +01:00
parent f44507a69b
commit 874f2592ca
14 changed files with 42 additions and 64 deletions

View file

@ -1,6 +1,5 @@
import ko from 'ko';
import { Capa } from 'Common/Enums';
import { SettingsCapa, SettingsGet } from 'Common/Globals';
import { AccountUserStore } from 'Stores/User/Account';
@ -14,8 +13,8 @@ import { IdentityPopupView } from 'View/Popup/Identity';
export class AccountsUserSettings /*extends AbstractViewSettings*/ {
constructor() {
this.allowAdditionalAccount = SettingsCapa(Capa.AdditionalAccounts);
this.allowIdentities = SettingsCapa(Capa.Identities);
this.allowAdditionalAccount = SettingsCapa('AdditionalAccounts');
this.allowIdentities = SettingsCapa('Identities');
this.accounts = AccountUserStore.accounts;
this.loading = AccountUserStore.loading;

View file

@ -9,7 +9,6 @@ import { showScreenPopup } from 'Knoin/Knoin';
import { OpenPgpImportPopupView } from 'View/Popup/OpenPgpImport';
import { OpenPgpGeneratePopupView } from 'View/Popup/OpenPgpGenerate';
import { Capa } from 'Common/Enums';
import { SettingsCapa } from 'Common/Globals';
export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
@ -20,7 +19,7 @@ export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
this.openpgpkeysPublic = OpenPGPUserStore.publicKeys;
this.openpgpkeysPrivate = OpenPGPUserStore.privateKeys;
this.canOpenPGP = SettingsCapa(Capa.OpenPGP);
this.canOpenPGP = SettingsCapa('OpenPGP');
this.canGnuPG = GnuPGUserStore.isSupported();
this.canMailvelope = !!window.mailvelope;

View file

@ -1,6 +1,5 @@
import { koComputable } from 'External/ko';
import { Capa } from 'Common/Enums';
import { SettingsCapa } from 'Common/Globals';
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
@ -12,7 +11,7 @@ export class SecurityUserSettings extends AbstractViewSettings {
constructor() {
super();
this.capaAutoLogout = SettingsCapa(Capa.AutoLogout);
this.capaAutoLogout = SettingsCapa('AutoLogout');
this.autoLogout = SettingsUserStore.autoLogout;

View file

@ -1,6 +1,6 @@
import { addObservablesTo } from 'External/ko';
import { SaveSettingsStep, UploadErrorCode, Capa } from 'Common/Enums';
import { SaveSettingsStep, UploadErrorCode } from 'Common/Enums';
import { changeTheme, convertThemeName } from 'Common/Utils';
import { themePreviewLink, serverRequest } from 'Common/Links';
import { i18n } from 'Common/Translator';
@ -26,7 +26,7 @@ export class ThemesUserSettings /*extends AbstractViewSettings*/ {
this.themes = ThemeStore.themes;
this.themesObjects = ko.observableArray();
themeBackground.enabled = SettingsCapa(Capa.UserBackground);
themeBackground.enabled = SettingsCapa('UserBackground');
this.background = themeBackground;
this.themeTrigger = ko.observable(SaveSettingsStep.Idle).extend({ debounce: 100 });