Skip to content

Commit 24b169d

Browse files
committed
fix(type_widgets): "empty" note type displayed on refresh
1 parent b36ef54 commit 24b169d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/client/src/widgets/NoteDetail.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ async function getCorrespondingWidget(type: ExtendedNoteType): Promise<null | Ty
277277
}
278278
}
279279

280-
async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType> {
280+
async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType | undefined> {
281281
if (!note) {
282-
console.log("Returning empty because no note.");
283-
return "empty";
282+
// If the note is null, then it's a new tab. If it's undefined, then it's not loaded yet.
283+
return note === null ? "empty" : undefined;
284284
}
285285

286286
const type = note.type;

0 commit comments

Comments
 (0)