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;