mirror of https://github.com/laurent22/joplin.git
Fixed state handling issue when deleting note
parent
218405503d
commit
3cb52a4107
|
@ -161,7 +161,7 @@ class AppGui {
|
||||||
let note = noteList.currentItem;
|
let note = noteList.currentItem;
|
||||||
this.store_.dispatch({
|
this.store_.dispatch({
|
||||||
type: 'NOTES_SELECT',
|
type: 'NOTES_SELECT',
|
||||||
noteId: note ? note.id : 0,
|
noteId: note ? note.id : null,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.rootWidget_.connect(noteList, (state) => {
|
this.rootWidget_.connect(noteList, (state) => {
|
||||||
|
|
|
@ -594,10 +594,6 @@ class Application {
|
||||||
if (!currentFolder) currentFolder = await Folder.defaultFolder();
|
if (!currentFolder) currentFolder = await Folder.defaultFolder();
|
||||||
Setting.setValue('activeFolderId', currentFolder ? currentFolder.id : '');
|
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
|
// If we have some arguments left at this point, it's a command
|
||||||
// so execute it.
|
// so execute it.
|
||||||
if (argv.length) {
|
if (argv.length) {
|
||||||
|
|
|
@ -25,8 +25,9 @@ class NoteWidget extends TextWidget {
|
||||||
async onWillRender() {
|
async onWillRender() {
|
||||||
if (!this.note_ && this.noteId_) {
|
if (!this.note_ && this.noteId_) {
|
||||||
this.note_ = await Note.load(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 : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue