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

@ -3,7 +3,7 @@ import ko from 'ko';
import {
SaveSettingsStep,
Notification,
KeyState
Scope
} from 'Common/Enums';
import { ComposeType } from 'Common/EnumsUser';
@ -94,8 +94,6 @@ class ContactsPopupView extends AbstractViewPopup {
// this.saveCommandDebounce = _.debounce(this.saveCommand.bind(this), 1000);
this.sDefaultKeyScope = KeyState.ContactList;
const
// propertyFocused = property => !property.isValid() && !property.focused(),
pagecount = () => Math.max(1, Math.ceil(this.contactsCount() / CONTACTS_PER_PAGE));
@ -490,14 +488,14 @@ class ContactsPopupView extends AbstractViewPopup {
}
onBuild(dom) {
this.selector.init(dom.querySelector('.b-list-content'), KeyState.ContactList);
this.selector.init(dom.querySelector('.b-list-content'), Scope.Contacts);
shortcuts.add('delete', '', KeyState.ContactList, () => {
shortcuts.add('delete', '', Scope.Contacts, () => {
this.deleteCommand();
return false;
});
shortcuts.add('c,w', '', KeyState.ContactList, () => {
shortcuts.add('c,w', '', Scope.Contacts, () => {
this.newMessageCommand();
return false;
});