WIP
This commit is contained in:
@@ -60,18 +60,18 @@ export class PureCtrl {
|
||||
this.onAppStart();
|
||||
}
|
||||
if (!this.appState.isLocked()) {
|
||||
this.onAppUnlock();
|
||||
this.onAppLaunch();
|
||||
}
|
||||
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
||||
this.onAppEvent(eventName);
|
||||
if (eventName === ApplicationEvents.Started) {
|
||||
await this.resetState();
|
||||
await this.onAppStart();
|
||||
} else if (eventName === ApplicationEvents.Unlocked) {
|
||||
await this.onAppUnlock();
|
||||
} else if (eventName === ApplicationEvents.Launched) {
|
||||
await this.onAppLaunch();
|
||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
||||
this.onAppSync();
|
||||
} else if (eventName === ApplicationEvents.KeyStatusChange) {
|
||||
} else if (eventName === ApplicationEvents.KeyStatusChanged) {
|
||||
this.onAppKeyChange();
|
||||
}
|
||||
});
|
||||
@@ -89,7 +89,7 @@ export class PureCtrl {
|
||||
/** Optional override */
|
||||
}
|
||||
|
||||
async onAppUnlock() {
|
||||
async onAppLaunch() {
|
||||
/** Optional override */
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@ class EditorCtrl extends PureCtrl {
|
||||
this.prefKeyMarginResizers = PrefKeys.EditorResizersEnabled;
|
||||
}
|
||||
|
||||
onAppUnlock() {
|
||||
super.onAppUnlock();
|
||||
onAppLaunch() {
|
||||
super.onAppLaunch();
|
||||
this.streamItems();
|
||||
this.registerComponentHandler();
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ class FooterCtrl extends PureCtrl {
|
||||
});
|
||||
}
|
||||
|
||||
onAppUnlock() {
|
||||
super.onAppUnlock();
|
||||
onAppLaunch() {
|
||||
super.onAppLaunch();
|
||||
this.application.hasPasscode().then((value) => {
|
||||
this.setState({
|
||||
hasPasscode: value
|
||||
|
||||
@@ -78,8 +78,8 @@ class NotesCtrl extends PureCtrl {
|
||||
});
|
||||
}
|
||||
|
||||
onAppUnlock() {
|
||||
super.onAppUnlock();
|
||||
onAppLaunch() {
|
||||
super.onAppLaunch();
|
||||
this.streamNotesAndTags();
|
||||
this.reloadPreferences();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Challenges, ChallengeResponse, ApplicationEvents } from 'snjs';
|
||||
import { Challenges, ChallengeResponse } from 'snjs';
|
||||
import { getPlatformString } from '@/utils';
|
||||
import template from '%/root.pug';
|
||||
import { AppStateEvents } from '@/state';
|
||||
@@ -46,12 +46,12 @@ class RootCtrl extends PureCtrl {
|
||||
|
||||
onAppStart() {
|
||||
super.onAppStart();
|
||||
this.setState({ ready: false });
|
||||
this.setState({ ready: true });
|
||||
}
|
||||
|
||||
onAppUnlock() {
|
||||
super.onAppUnlock();
|
||||
this.setState({ ready: true, needsUnlock: false });
|
||||
onAppLaunch() {
|
||||
super.onAppLaunch();
|
||||
this.setState({ needsUnlock: false });
|
||||
this.application.componentManager.setDesktopManager(this.desktopManager);
|
||||
this.application.registerService(this.themeManager);
|
||||
this.handleAutoSignInFromParams();
|
||||
|
||||
@@ -34,8 +34,8 @@ class TagsPanelCtrl extends PureCtrl {
|
||||
this.registerComponentHandler();
|
||||
}
|
||||
|
||||
onAppUnlock() {
|
||||
super.onAppUnlock();
|
||||
onAppLaunch() {
|
||||
super.onAppLaunch();
|
||||
this.loadPreferences();
|
||||
this.beginStreamingItems();
|
||||
const smartTags = this.application.getSmartTags();
|
||||
|
||||
Reference in New Issue
Block a user