fix(type_widgets): "empty" note type displayed on refresh

This commit is contained in:
Elian Doran 2025-11-09 13:52:07 +02:00
parent b36ef54507
commit 24b169d667
No known key found for this signature in database

View File

@ -277,10 +277,10 @@ async function getCorrespondingWidget(type: ExtendedNoteType): Promise<null | Ty
} }
} }
async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType> { async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType | undefined> {
if (!note) { if (!note) {
console.log("Returning empty because no note."); // If the note is null, then it's a new tab. If it's undefined, then it's not loaded yet.
return "empty"; return note === null ? "empty" : undefined;
} }
const type = note.type; const type = note.type;