Cleanup AppUserStore

Simplify KeyState/Focused as Scope enum
This commit is contained in:
djmaze 2021-03-16 16:06:16 +01:00
parent 62cb918180
commit eff92c3152
27 changed files with 177 additions and 232 deletions

View file

@ -2,7 +2,7 @@ import { AppUserStore } from 'Stores/User/App';
import { AccountUserStore } from 'Stores/User/Account';
import { MessageUserStore } from 'Stores/User/Message';
import { Capa, KeyState } from 'Common/Enums';
import { Capa, Scope } from 'Common/Enums';
import { settings } from 'Common/Links';
import { showScreenPopup } from 'Knoin/Knoin';
@ -36,7 +36,7 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
capaAdditionalAccounts: Settings.capa(Capa.AdditionalAccounts)
});
this.allowContacts = !!AppUserStore.contactsIsAllowed();
this.allowContacts = AppUserStore.contactsIsAllowed();
this.addAccountClick = this.addAccountClick.bind(this);
@ -106,7 +106,7 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
}
onBuild() {
shortcuts.add('m,contextmenu', '', [KeyState.MessageList, KeyState.MessageView, KeyState.Settings], () => {
shortcuts.add('m,contextmenu', '', [Scope.MessageList, Scope.MessageView, Scope.Settings], () => {
if (this.viewModelVisible) {
MessageUserStore.messageFullScreenMode(false);
this.accountMenuDropdownTrigger(true);
@ -115,7 +115,7 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
});
// shortcuts help
shortcuts.add('?,f1,help', '', [KeyState.MessageList, KeyState.MessageView, KeyState.Settings], () => {
shortcuts.add('?,f1,help', '', [Scope.MessageList, Scope.MessageView, Scope.Settings], () => {
if (this.viewModelVisible) {
showScreenPopup(KeyboardShortcutsHelpPopupView);
return false;