Restructure Capa

This commit is contained in:
the-djmaze 2022-02-24 12:22:27 +01:00
parent 5990addfef
commit e7c7b8ed53
15 changed files with 74 additions and 140 deletions

View file

@ -8,7 +8,7 @@ import { IdentityUserStore } from 'Stores/User/Identity';
import { AbstractViewPopup } from 'Knoin/AbstractViews';
import { Capa } from 'Common/Enums';
import { Settings } from 'Common/Globals';
import { SettingsCapa } from 'Common/Globals';
export class OpenPgpGeneratePopupView extends AbstractViewPopup {
constructor() {
@ -34,7 +34,7 @@ export class OpenPgpGeneratePopupView extends AbstractViewPopup {
saveGnuPGPrivate: false
});
this.canGnuPG = Settings.capa(Capa.GnuPG);
this.canGnuPG = SettingsCapa(Capa.GnuPG);
this.email.subscribe(() => this.emailError(false));
}

View file

@ -828,7 +828,7 @@ export class MailMessageList extends AbstractViewRight {
shortcuts.add('arrowleft', 'meta', Scope.MessageView, ()=>false);
shortcuts.add('arrowright', 'meta', Scope.MessageView, ()=>false);
if (!ThemeStore.isMobile() && SettingsCapa(Capa.Prefetch)) {
if (!ThemeStore.isMobile() && SettingsCapa('Prefetch')) {
ifvisible.idle(this.prefetchNextTick.bind(this));
}
}

View file

@ -2,10 +2,7 @@ import ko from 'ko';
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
import {
Capa,
Scope
} from 'Common/Enums';
import { Scope } from 'Common/Enums';
import {
ComposeType,
@ -93,7 +90,7 @@ export class MailMessageView extends AbstractViewRight {
this.moveAction = moveAction;
this.allowMessageActions = SettingsCapa(Capa.MessageActions);
this.allowMessageActions = SettingsCapa('MessageActions');
const attachmentsActions = Settings.app('attachmentsActions');
this.attachmentsActions = ko.observableArray(arrayLength(attachmentsActions) ? attachmentsActions : []);
@ -132,7 +129,7 @@ export class MailMessageView extends AbstractViewRight {
this.viewHash = '';
this.addComputables({
allowAttachmentControls: () => this.attachmentsActions.length && SettingsCapa(Capa.AttachmentsActions),
allowAttachmentControls: () => this.attachmentsActions.length && SettingsCapa('AttachmentsActions'),
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip') && this.allowAttachmentControls(),

View file

@ -13,7 +13,7 @@ import { KeyboardShortcutsHelpPopupView } from 'View/Popup/KeyboardShortcutsHelp
import { AccountPopupView } from 'View/Popup/Account';
import { ContactsPopupView } from 'View/Popup/Contacts';
import { doc, Settings/*, SettingsGet*/, leftPanelDisabled, fireEvent } from 'Common/Globals';
import { doc, leftPanelDisabled, fireEvent, SettingsCapa } from 'Common/Globals';
import { ThemeStore } from 'Stores/Theme';
@ -26,7 +26,7 @@ export class SystemDropDownUserView extends AbstractViewRight {
constructor() {
super('SystemDropDown');
this.allowAccounts = Settings.capa(Capa.AdditionalAccounts);
this.allowAccounts = SettingsCapa(Capa.AdditionalAccounts);
this.accountEmail = AccountUserStore.email;