fix(client/type_widgets): empty tab not working when closing last tab

This commit is contained in:
Elian Doran 2025-11-09 20:41:29 +02:00
parent 7ba91b7a9d
commit 763fa0b515
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View File

@ -265,6 +265,7 @@ export default class TabManager extends Component {
mainNtxId: string | null = null mainNtxId: string | null = null
): Promise<NoteContext> { ): Promise<NoteContext> {
const noteContext = new NoteContext(ntxId, hoistedNoteId, mainNtxId); const noteContext = new NoteContext(ntxId, hoistedNoteId, mainNtxId);
noteContext.setEmpty();
const existingNoteContext = this.children.find((nc) => nc.ntxId === noteContext.ntxId); const existingNoteContext = this.children.find((nc) => nc.ntxId === noteContext.ntxId);

View File

@ -278,6 +278,7 @@ async function getCorrespondingWidget(type: ExtendedNoteType): Promise<null | Ty
} }
async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType | undefined> { async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType | undefined> {
if (!noteContext) return undefined;
if (!note) { if (!note) {
// If the note is null, then it's a new tab. If it's undefined, then it's not loaded yet. // 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; return note === null ? "empty" : undefined;