WIP
This commit is contained in:
@@ -112,17 +112,13 @@ class EditorCtrl extends PureCtrl {
|
||||
return;
|
||||
}
|
||||
if (eventName === ApplicationEvents.HighLatencySync) {
|
||||
this.setState({
|
||||
syncTakingTooLong: true
|
||||
});
|
||||
this.setState({ syncTakingTooLong: true });
|
||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
||||
this.setState({
|
||||
syncTakingTooLong: false
|
||||
});
|
||||
this.setState({ syncTakingTooLong: false });
|
||||
if (this.state.note.dirty) {
|
||||
/** if we're still dirty, don't change status, a sync is likely upcoming. */
|
||||
} else {
|
||||
const saved = this.state.note.updated_at > this.state.note.lastSyncBegan;
|
||||
const saved = this.state.note.lastSyncEnd > this.state.note.lastSyncBegan;
|
||||
const isInErrorState = this.state.saveError;
|
||||
if (isInErrorState || saved) {
|
||||
this.showAllChangesSavedStatus();
|
||||
@@ -792,8 +788,8 @@ class EditorCtrl extends PureCtrl {
|
||||
this.reloadFont();
|
||||
|
||||
if (
|
||||
this.state.marginResizersEnabled &&
|
||||
this.leftPanelPuppet.ready &&
|
||||
this.state.marginResizersEnabled &&
|
||||
this.leftPanelPuppet.ready &&
|
||||
this.rightPanelPuppet.ready
|
||||
) {
|
||||
const width = this.preferencesManager.getValue(
|
||||
|
||||
@@ -59,7 +59,6 @@ class FooterCtrl extends PureCtrl {
|
||||
});
|
||||
this.user = this.application.getUser();
|
||||
this.updateOfflineStatus();
|
||||
this.addAppEventObserver();
|
||||
this.findErrors();
|
||||
this.streamItems();
|
||||
this.registerComponentHandler();
|
||||
@@ -111,15 +110,14 @@ class FooterCtrl extends PureCtrl {
|
||||
|
||||
/** @override */
|
||||
onApplicationEvent(eventName) {
|
||||
if (eventName === ApplicationEvents.LoadedLocalData) {
|
||||
if (this.offline && this.application.getNoteCount() === 0) {
|
||||
this.showAccountMenu = true;
|
||||
}
|
||||
} else if (eventName === ApplicationEvents.EnteredOutOfSync) {
|
||||
if (eventName === ApplicationEvents.EnteredOutOfSync) {
|
||||
this.outOfSync = true;
|
||||
} else if (eventName === ApplicationEvents.ExitedOutOfSync) {
|
||||
this.outOfSync = false;
|
||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
||||
if (this.offline && this.application.getNoteCount() === 0) {
|
||||
this.showAccountMenu = true;
|
||||
}
|
||||
this.syncUpdated();
|
||||
this.findErrors();
|
||||
this.updateOfflineStatus();
|
||||
|
||||
@@ -113,6 +113,9 @@ class NotesCtrl extends PureCtrl {
|
||||
this.createDummyOnSynCompletionIfNoNotes = true;
|
||||
}
|
||||
} else if (eventName === ApplicationEvents.CompletedSync) {
|
||||
if (this.state.notes.length === 0) {
|
||||
this.createNewNote();
|
||||
}
|
||||
if (this.createDummyOnSynCompletionIfNoNotes && this.state.notes.length === 0) {
|
||||
this.createDummyOnSynCompletionIfNoNotes = false;
|
||||
this.createNewNote();
|
||||
|
||||
@@ -37,7 +37,7 @@ class RootCtrl extends PureCtrl {
|
||||
this.themeManager = themeManager;
|
||||
this.platformString = getPlatformString();
|
||||
this.state = {
|
||||
needsUnlock: true,
|
||||
ready: false,
|
||||
appClass: ''
|
||||
};
|
||||
this.loadApplication();
|
||||
@@ -86,17 +86,18 @@ class RootCtrl extends PureCtrl {
|
||||
}
|
||||
});
|
||||
await this.application.launch();
|
||||
this.setState({ ready: true });
|
||||
// this.addSyncStatusObserver();
|
||||
// this.addSyncEventHandler();
|
||||
}
|
||||
|
||||
|
||||
onUpdateAvailable() {
|
||||
this.$rootScope.$broadcast('new-update-available');
|
||||
};
|
||||
|
||||
|
||||
/** @override */
|
||||
async onApplicationEvent(eventName) {
|
||||
if (eventName === ApplicationEvents.ApplicationUnlocked) {
|
||||
if (eventName === ApplicationEvents.ApplicationUnlocked) {
|
||||
this.setState({ needsUnlock: false });
|
||||
this.application.componentManager.setDesktopManager(this.desktopManager);
|
||||
this.application.registerService(this.themeManager);
|
||||
|
||||
Reference in New Issue
Block a user