From 3cb52a4107e9ebd4c09347a0ec716a4a75691ee6 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 24 Oct 2017 18:17:49 +0000 Subject: [PATCH] Fixed state handling issue when deleting note --- CliClient/app/app-gui.js | 2 +- CliClient/app/app.js | 4 ---- CliClient/app/gui/NoteWidget.js | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CliClient/app/app-gui.js b/CliClient/app/app-gui.js index 5991c7a01c..6141d82123 100644 --- a/CliClient/app/app-gui.js +++ b/CliClient/app/app-gui.js @@ -161,7 +161,7 @@ class AppGui { let note = noteList.currentItem; this.store_.dispatch({ type: 'NOTES_SELECT', - noteId: note ? note.id : 0, + noteId: note ? note.id : null, }); }); this.rootWidget_.connect(noteList, (state) => { diff --git a/CliClient/app/app.js b/CliClient/app/app.js index ac39ae2f4d..1a156782ca 100644 --- a/CliClient/app/app.js +++ b/CliClient/app/app.js @@ -594,10 +594,6 @@ class Application { if (!currentFolder) currentFolder = await Folder.defaultFolder(); Setting.setValue('activeFolderId', currentFolder ? currentFolder.id : ''); - setInterval(() => { - this.logger().debug(Setting.value('activeFolderId'), this.store().getState().settings.activeFolderId, this.store().getState().selectedFolderId); - }, 1000); - // If we have some arguments left at this point, it's a command // so execute it. if (argv.length) { diff --git a/CliClient/app/gui/NoteWidget.js b/CliClient/app/gui/NoteWidget.js index ceaadb99b6..67e56e6b63 100644 --- a/CliClient/app/gui/NoteWidget.js +++ b/CliClient/app/gui/NoteWidget.js @@ -25,8 +25,9 @@ class NoteWidget extends TextWidget { async onWillRender() { if (!this.note_ && this.noteId_) { this.note_ = await Note.load(this.noteId_); - this.text = this.note_.title + "\n\n" + this.note_.body; } + + this.text = this.note_ ? this.note_.title + "\n\n" + this.note_.body : ''; } }