Skip to content

Commit

Permalink
account for null in camera select
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Nov 27, 2024
1 parent da27ce0 commit 043318b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/desktop/src/routes/(window-chrome)/(main).tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function CameraSelect(props: {
return (
<div class="flex flex-col gap-[0.25rem] items-stretch text-[--text-primary]">
<label class="text-[--text-tertiary] text-[0.875rem]">Camera</label>
<KSelect<Option>
<KSelect<Option | null>
options={selectOptions()}
optionValue="name"
optionTextValue="name"
Expand All @@ -409,7 +409,7 @@ function CameraSelect(props: {
itemComponent={(props) => (
<MenuItem<typeof KSelect.Item> as={KSelect.Item} item={props.item}>
<KSelect.ItemLabel class="flex-1">
{props.item.rawValue.name}
{props.item.rawValue?.name}
</KSelect.ItemLabel>
</MenuItem>
)}
Expand All @@ -425,8 +425,8 @@ function CameraSelect(props: {
>
<KSelect.Trigger class="flex flex-row items-center h-[2rem] px-[0.375rem] gap-[0.375rem] border rounded-lg border-gray-200 w-full disabled:text-gray-400 transition-colors KSelect">
<IconCapCamera class="text-gray-400 size-[1.25rem]" />
<KSelect.Value<Option> class="flex-1 text-left truncate">
{(state) => <span>{state.selectedOption().name}</span>}
<KSelect.Value<Option | null> class="flex-1 text-left truncate">
{(state) => <span>{state.selectedOption()?.name}</span>}
</KSelect.Value>
<TargetSelectInfoPill
value={props.options?.cameraLabel ?? null}
Expand Down

1 comment on commit 043318b

@vercel
Copy link

@vercel vercel bot commented on 043318b Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.