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

@@ -76,10 +76,12 @@ class NotesCtrl extends PureCtrl {
angular.element(document).ready(() => {
this.reloadPreferences();
});
application.onUnlock(() => {
this.streamNotesAndTags();
this.reloadPreferences();
});
}
onAppUnlock() {
super.onAppUnlock();
this.streamNotesAndTags();
this.reloadPreferences();
}
/** @override */
@@ -97,7 +99,7 @@ class NotesCtrl extends PureCtrl {
}
/** @override */
onApplicationEvent(eventName) {
onAppEvent(eventName) {
if (eventName === ApplicationEvents.SignedIn) {
/** Delete dummy note if applicable */
if (this.state.selectedNote && this.state.selectedNote.dummy) {
@@ -430,10 +432,17 @@ class NotesCtrl extends PureCtrl {
});
}
if (note.errorDecrypting) {
flags.push({
text: "Missing Keys",
class: 'danger'
});
if(note.waitingForKeys) {
flags.push({
text: "Waiting For Keys",
class: 'info'
});
} else {
flags.push({
text: "Missing Keys",
class: 'danger'
});
}
}
if (note.deleted) {
flags.push({