Skip to content

Commit 763fa0b

Browse files
committed
fix(client/type_widgets): empty tab not working when closing last tab
1 parent 7ba91b7 commit 763fa0b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

apps/client/src/components/tab_manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ export default class TabManager extends Component {
265265
mainNtxId: string | null = null
266266
): Promise<NoteContext> {
267267
const noteContext = new NoteContext(ntxId, hoistedNoteId, mainNtxId);
268+
noteContext.setEmpty();
268269

269270
const existingNoteContext = this.children.find((nc) => nc.ntxId === noteContext.ntxId);
270271

apps/client/src/widgets/NoteDetail.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ async function getCorrespondingWidget(type: ExtendedNoteType): Promise<null | Ty
278278
}
279279

280280
async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType | undefined> {
281+
if (!noteContext) return undefined;
281282
if (!note) {
282283
// If the note is null, then it's a new tab. If it's undefined, then it's not loaded yet.
283284
return note === null ? "empty" : undefined;

0 commit comments

Comments
 (0)