We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b36ef54 commit 24b169dCopy full SHA for 24b169d
apps/client/src/widgets/NoteDetail.tsx
@@ -277,10 +277,10 @@ async function getCorrespondingWidget(type: ExtendedNoteType): Promise<null | Ty
277
}
278
279
280
-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> {
281
if (!note) {
282
- console.log("Returning empty because no note.");
283
- return "empty";
+ // 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;
284
285
286
const type = note.type;
0 commit comments