Skip to content

Build your personal knowledge base with Trilium Notes

close last tab should behave similarly to 0.47, fixes #2298

zadamfc46398a3cd0
diff --git a/src/public/app/services/note_context.js b/src/public/app/services/note_context.js
index 95d8140864..ee02c0d775 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 d14107ad2a..065a295563 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;
}
}