1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Fixed state handling issue when deleting note

This commit is contained in:
Laurent Cozic 2017-10-24 18:17:49 +00:00
parent 218405503d
commit 3cb52a4107
3 changed files with 3 additions and 6 deletions

View File

@ -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) => {

View File

@ -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) {

View File

@ -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 : '';
}
}