From 763fa0b5158bc323e8138b9cafa96f7e18c04107 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 9 Nov 2025 20:41:29 +0200 Subject: [PATCH] fix(client/type_widgets): empty tab not working when closing last tab --- apps/client/src/components/tab_manager.ts | 1 + apps/client/src/widgets/NoteDetail.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/client/src/components/tab_manager.ts b/apps/client/src/components/tab_manager.ts index 03b9d98d6..517ff2501 100644 --- a/apps/client/src/components/tab_manager.ts +++ b/apps/client/src/components/tab_manager.ts @@ -265,6 +265,7 @@ export default class TabManager extends Component { mainNtxId: string | null = null ): Promise { const noteContext = new NoteContext(ntxId, hoistedNoteId, mainNtxId); + noteContext.setEmpty(); const existingNoteContext = this.children.find((nc) => nc.ntxId === noteContext.ntxId); diff --git a/apps/client/src/widgets/NoteDetail.tsx b/apps/client/src/widgets/NoteDetail.tsx index 07035102e..03b0b6476 100644 --- a/apps/client/src/widgets/NoteDetail.tsx +++ b/apps/client/src/widgets/NoteDetail.tsx @@ -278,6 +278,7 @@ async function getCorrespondingWidget(type: ExtendedNoteType): Promise { + if (!noteContext) return undefined; if (!note) { // If the note is null, then it's a new tab. If it's undefined, then it's not loaded yet. return note === null ? "empty" : undefined;