WIP
This commit is contained in:
@@ -60,18 +60,18 @@ export class PureCtrl {
|
|||||||
this.onAppStart();
|
this.onAppStart();
|
||||||
}
|
}
|
||||||
if (!this.appState.isLocked()) {
|
if (!this.appState.isLocked()) {
|
||||||
this.onAppUnlock();
|
this.onAppLaunch();
|
||||||
}
|
}
|
||||||
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
||||||
this.onAppEvent(eventName);
|
this.onAppEvent(eventName);
|
||||||
if (eventName === ApplicationEvents.Started) {
|
if (eventName === ApplicationEvents.Started) {
|
||||||
await this.resetState();
|
await this.resetState();
|
||||||
await this.onAppStart();
|
await this.onAppStart();
|
||||||
} else if (eventName === ApplicationEvents.Unlocked) {
|
} else if (eventName === ApplicationEvents.Launched) {
|
||||||
await this.onAppUnlock();
|
await this.onAppLaunch();
|
||||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
} else if (eventName === ApplicationEvents.CompletedSync) {
|
||||||
this.onAppSync();
|
this.onAppSync();
|
||||||
} else if (eventName === ApplicationEvents.KeyStatusChange) {
|
} else if (eventName === ApplicationEvents.KeyStatusChanged) {
|
||||||
this.onAppKeyChange();
|
this.onAppKeyChange();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -89,7 +89,7 @@ export class PureCtrl {
|
|||||||
/** Optional override */
|
/** Optional override */
|
||||||
}
|
}
|
||||||
|
|
||||||
async onAppUnlock() {
|
async onAppLaunch() {
|
||||||
/** Optional override */
|
/** Optional override */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ class EditorCtrl extends PureCtrl {
|
|||||||
this.prefKeyMarginResizers = PrefKeys.EditorResizersEnabled;
|
this.prefKeyMarginResizers = PrefKeys.EditorResizersEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppUnlock() {
|
onAppLaunch() {
|
||||||
super.onAppUnlock();
|
super.onAppLaunch();
|
||||||
this.streamItems();
|
this.streamItems();
|
||||||
this.registerComponentHandler();
|
this.registerComponentHandler();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ class FooterCtrl extends PureCtrl {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppUnlock() {
|
onAppLaunch() {
|
||||||
super.onAppUnlock();
|
super.onAppLaunch();
|
||||||
this.application.hasPasscode().then((value) => {
|
this.application.hasPasscode().then((value) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
hasPasscode: value
|
hasPasscode: value
|
||||||
|
|||||||
@@ -78,8 +78,8 @@ class NotesCtrl extends PureCtrl {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppUnlock() {
|
onAppLaunch() {
|
||||||
super.onAppUnlock();
|
super.onAppLaunch();
|
||||||
this.streamNotesAndTags();
|
this.streamNotesAndTags();
|
||||||
this.reloadPreferences();
|
this.reloadPreferences();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Challenges, ChallengeResponse, ApplicationEvents } from 'snjs';
|
import { Challenges, ChallengeResponse } from 'snjs';
|
||||||
import { getPlatformString } from '@/utils';
|
import { getPlatformString } from '@/utils';
|
||||||
import template from '%/root.pug';
|
import template from '%/root.pug';
|
||||||
import { AppStateEvents } from '@/state';
|
import { AppStateEvents } from '@/state';
|
||||||
@@ -46,12 +46,12 @@ class RootCtrl extends PureCtrl {
|
|||||||
|
|
||||||
onAppStart() {
|
onAppStart() {
|
||||||
super.onAppStart();
|
super.onAppStart();
|
||||||
this.setState({ ready: false });
|
this.setState({ ready: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppUnlock() {
|
onAppLaunch() {
|
||||||
super.onAppUnlock();
|
super.onAppLaunch();
|
||||||
this.setState({ ready: true, needsUnlock: false });
|
this.setState({ needsUnlock: false });
|
||||||
this.application.componentManager.setDesktopManager(this.desktopManager);
|
this.application.componentManager.setDesktopManager(this.desktopManager);
|
||||||
this.application.registerService(this.themeManager);
|
this.application.registerService(this.themeManager);
|
||||||
this.handleAutoSignInFromParams();
|
this.handleAutoSignInFromParams();
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ class TagsPanelCtrl extends PureCtrl {
|
|||||||
this.registerComponentHandler();
|
this.registerComponentHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppUnlock() {
|
onAppLaunch() {
|
||||||
super.onAppUnlock();
|
super.onAppLaunch();
|
||||||
this.loadPreferences();
|
this.loadPreferences();
|
||||||
this.beginStreamingItems();
|
this.beginStreamingItems();
|
||||||
const smartTags = this.application.getSmartTags();
|
const smartTags = this.application.getSmartTags();
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ class AccountMenuCtrl extends PureCtrl {
|
|||||||
};
|
};
|
||||||
this.syncStatus = this.application.getSyncStatus();
|
this.syncStatus = this.application.getSyncStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
async onAppKeyChange() {
|
async onAppKeyChange() {
|
||||||
super.onAppKeyChange();
|
super.onAppKeyChange();
|
||||||
this.setState(await this.refreshedCredentialState());
|
this.setState(await this.refreshedCredentialState());
|
||||||
}
|
}
|
||||||
|
|
||||||
async onAppUnlock() {
|
async onAppLaunch() {
|
||||||
super.onAppUnlock();
|
super.onAppLaunch();
|
||||||
this.setState(await this.refreshedCredentialState());
|
this.setState(await this.refreshedCredentialState());
|
||||||
this.loadHost();
|
this.loadHost();
|
||||||
this.checkForSecurityUpdate();
|
this.checkForSecurityUpdate();
|
||||||
@@ -477,11 +477,11 @@ class AccountMenuCtrl extends PureCtrl {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const func = this.state.formData.changingPasscode
|
(this.state.formData.changingPasscode
|
||||||
? this.application.changePasscode.bind(this.application)
|
? this.application.changePasscode(passcode)
|
||||||
: this.application.setPasscode.bind(this.application);
|
: this.application.setPasscode(passcode)
|
||||||
func(passcode, async () => {
|
).then(() => {
|
||||||
await this.setFormDataState({
|
this.setFormDataState({
|
||||||
passcode: null,
|
passcode: null,
|
||||||
confirmPasscode: null,
|
confirmPasscode: null,
|
||||||
showPasscodeForm: false
|
showPasscodeForm: false
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ class PrivilegesManagementModalCtrl extends PureCtrl {
|
|||||||
this.application = application;
|
this.application = application;
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppUnlock() {
|
onAppLaunch() {
|
||||||
super.onAppUnlock();
|
super.onAppLaunch();
|
||||||
this.hasPasscode = this.application.hasPasscode();
|
this.hasPasscode = this.application.hasPasscode();
|
||||||
this.hasAccount = !this.application.noAccount();
|
this.hasAccount = !this.application.noAccount();
|
||||||
this.reloadPrivileges();
|
this.reloadPrivileges();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class NativeExtManager {
|
|||||||
this.extManagerId = 'org.standardnotes.extensions-manager';
|
this.extManagerId = 'org.standardnotes.extensions-manager';
|
||||||
this.batchManagerId = 'org.standardnotes.batch-manager';
|
this.batchManagerId = 'org.standardnotes.batch-manager';
|
||||||
|
|
||||||
this.unsub = application.addSingleEventObserver(ApplicationEvents.Unlocked, () => {
|
this.unsub = application.addSingleEventObserver(ApplicationEvents.Launched, () => {
|
||||||
this.reload();
|
this.reload();
|
||||||
this.streamChanges();
|
this.streamChanges();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export class PreferencesManager {
|
|||||||
) {
|
) {
|
||||||
this.application = application;
|
this.application = application;
|
||||||
this.appState = appState;
|
this.appState = appState;
|
||||||
this.unsub = application.addSingleEventObserver(ApplicationEvents.Unlocked, () => {
|
this.unsub = application.addSingleEventObserver(ApplicationEvents.Launched, () => {
|
||||||
this.streamPreferences();
|
this.streamPreferences();
|
||||||
this.loadSingleton();
|
this.loadSingleton();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export class AppState {
|
|||||||
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
||||||
if (eventName === ApplicationEvents.Started) {
|
if (eventName === ApplicationEvents.Started) {
|
||||||
this.locked = true;
|
this.locked = true;
|
||||||
} else if (eventName === ApplicationEvents.Unlocked) {
|
} else if (eventName === ApplicationEvents.Launched) {
|
||||||
this.locked = false;
|
this.locked = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @keychian */
|
/** @keychian */
|
||||||
async getRawKeychainValue() {
|
async getKeychainValue() {
|
||||||
const value = localStorage.getItem(KEYCHAIN_STORAGE_KEY);
|
const value = localStorage.getItem(KEYCHAIN_STORAGE_KEY);
|
||||||
if(value) {
|
if(value) {
|
||||||
return JSON.parse(value);
|
return JSON.parse(value);
|
||||||
|
|||||||
374
dist/javascripts/app.js
vendored
374
dist/javascripts/app.js
vendored
File diff suppressed because one or more lines are too long
2
dist/javascripts/app.js.map
vendored
2
dist/javascripts/app.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user