Skip to content

Commit 80fd39e

Browse files
fix: fall back to default option when selected combo value not found
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 17fa999 commit 80fd39e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/settings-page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ function ComboComponent(props: {
342342
}) {
343343
const [open, setOpen] = useState(false);
344344

345-
const selectedOption = props.setting.options.find(
346-
(option) => option.id === props.value,
347-
);
348-
if (!selectedOption) {
349-
throw new Error("Selected option not found");
345+
const selectedOption =
346+
props.setting.options.find((option) => option.id === props.value) ??
347+
props.setting.options[0];
348+
if (selectedOption.id !== props.value) {
349+
props.changeCallback(selectedOption.id);
350350
}
351351

352352
return (

0 commit comments

Comments
 (0)