Improve event handling + restarts

This commit is contained in:
Mo Bitar
2020-02-12 14:21:58 -06:00
parent 0fcfd98e5d
commit a364a9ec03
19 changed files with 1202 additions and 814 deletions

View File

@@ -81,18 +81,18 @@ class EditorCtrl extends PureCtrl {
onReady: () => this.reloadPreferences()
};
this.addSyncStatusObserver();
this.registerKeyboardShortcuts();
application.onUnlock(() => {
this.streamItems();
this.registerComponentHandler();
});
this.registerKeyboardShortcuts();
/** Used by .pug template */
this.prefKeyMonospace = PrefKeys.EditorMonospaceEnabled;
this.prefKeySpellcheck = PrefKeys.EditorSpellcheck;
this.prefKeyMarginResizers = PrefKeys.EditorResizersEnabled;
}
onAppUnlock() {
super.onAppUnlock();
this.streamItems();
this.registerComponentHandler();
}
/** @override */
onAppStateEvent(eventName, data) {
@@ -107,7 +107,7 @@ class EditorCtrl extends PureCtrl {
}
/** @override */
onApplicationEvent(eventName) {
onAppEvent(eventName) {
if (!this.state.note) {
return;
}