From c345e7031b7cbda843ca44963aa040c883a118d6 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 1 Nov 2021 08:50:01 +0100 Subject: [PATCH] fix hoisting note from empty detail screen --- src/public/app/services/note_context.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/note_context.js b/src/public/app/services/note_context.js index ee02c0d77..d2b4b4fb5 100644 --- a/src/public/app/services/note_context.js +++ b/src/public/app/services/note_context.js @@ -24,6 +24,7 @@ class NoteContext extends Component { this.notePath = null; this.noteId = null; this.parentNoteId = null; + this.hoistedNoteId = 'root'; this.triggerEvent('noteSwitched', { noteContext: this, @@ -165,12 +166,12 @@ class NoteContext extends Component { } async setHoistedNoteId(noteIdToHoist) { - if (this.notePathArray && !this.notePathArray.includes(noteIdToHoist)) { + this.hoistedNoteId = noteIdToHoist; + + if (!this.notePathArray?.includes(noteIdToHoist)) { await this.setNote(noteIdToHoist); } - this.hoistedNoteId = noteIdToHoist; - await this.triggerEvent('hoistedNoteChanged', { noteId: noteIdToHoist, ntxId: this.ntxId