From fc46398a3cd031902f902ffacb49742547efc6b3 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 1 Nov 2021 08:37:59 +0100 Subject: [PATCH] close last tab should behave similarly to 0.47, fixes #2298 --- src/public/app/services/note_context.js | 4 ++++ src/public/app/services/tab_manager.js | 1 + 2 files changed, 5 insertions(+) diff --git a/src/public/app/services/note_context.js b/src/public/app/services/note_context.js index 95d814086..ee02c0d77 100644 --- a/src/public/app/services/note_context.js +++ b/src/public/app/services/note_context.js @@ -21,6 +21,10 @@ class NoteContext extends Component { } setEmpty() { + this.notePath = null; + this.noteId = null; + this.parentNoteId = null; + this.triggerEvent('noteSwitched', { noteContext: this, notePath: this.notePath diff --git a/src/public/app/services/tab_manager.js b/src/public/app/services/tab_manager.js index d14107ad2..065a29556 100644 --- a/src/public/app/services/tab_manager.js +++ b/src/public/app/services/tab_manager.js @@ -305,6 +305,7 @@ export default class TabManager extends Component { const mainNoteContexts = this.getNoteContexts().filter(nc => nc.isMainContext()); if (mainNoteContexts.length === 1) { + mainNoteContexts[0].setEmpty(); return; } }