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

@@ -1,4 +1,4 @@
import { SFPredicate, ContentTypes, CreateMaxPayloadFromAnyObject } from 'snjs';
import { ApplicationEvents, SFPredicate, ContentTypes, CreateMaxPayloadFromAnyObject } from 'snjs';
export const PrefKeys = {
TagsPanelWidth: 'tagsPanelWidth',
@@ -24,8 +24,8 @@ export class PreferencesManager {
application
) {
this.application = application;
this.appState = appState;
application.onUnlock(() => {
this.appState = appState;
this.unsub = application.addSingleEventObserver(ApplicationEvents.Unlocked, () => {
this.streamPreferences();
this.loadSingleton();
});