chore(launch_bar): log warnings instead of crashing on a bad launcher

This commit is contained in:
Elian Doran 2026-02-22 11:35:46 +02:00
parent 82cae8ffbf
commit 6b4da33729
No known key found for this signature in database

View File

@ -67,7 +67,7 @@ function Launcher({ note, isHorizontalLayout }: { note: FNote, isHorizontalLayou
case "builtinWidget":
return initBuiltinWidget(note, isHorizontalLayout);
default:
throw new Error(`Unrecognized launcher type '${launcherType}' for launcher '${note.noteId}' title '${note.title}'`);
console.warn(`Unrecognized launcher type '${launcherType}' for launcher '${note.noteId}' title '${note.title}'`);
}
}
@ -99,7 +99,7 @@ function initBuiltinWidget(note: FNote, isHorizontalLayout: boolean) {
case "mobileTabSwitcher":
return <TabSwitcher />;
default:
throw new Error(`Unrecognized builtin widget ${builtinWidget} for launcher ${note.noteId} "${note.title}"`);
console.warn(`Unrecognized builtin widget ${builtinWidget} for launcher ${note.noteId} "${note.title}"`);
}
}