Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix: Better device selection on load
Richie McIlroyb03974153068
diff --git a/apps/desktop/src/routes/(window-chrome)/(main).tsx b/apps/desktop/src/routes/(window-chrome)/(main).tsxindex bba9e7cc2..f2854b797 100644--- a/apps/desktop/src/routes/(window-chrome)/(main).tsx+++ b/apps/desktop/src/routes/(window-chrome)/(main).tsx@@ -470,9 +470,13 @@ function MicrophoneSelect(props: {const [dbs, setDbs] = createSignal<number | undefined>();const [isInitialized, setIsInitialized] = createSignal(false);- const value = () =>- devices?.data?.find((d) => d.name === props.options?.audioInputName) ??- null;+ const value = createMemo(() => {+ if (!props.options?.audioInputName) return null;+ return (+ devices.data?.find((d) => d.name === props.options!.audioInputName) ??+ null+ );+ });const requestPermission = useRequestPermission();@@ -566,12 +570,17 @@ function MicrophoneSelect(props: {)}</Show><IconCapMicrophone class="text-gray-400 size-[1.25rem]" />- <KSelect.Value<{- name: string;- }> class="flex-1 text-left truncate">- {(state) => (- <span>{state.selectedOption()?.name ?? "No Audio"}</span>- )}+ <KSelect.Value<Option> class="flex-1 text-left truncate">+ {(state) => {+ const selected = state.selectedOption();+ return (+ <span>+ {selected?.name ??+ props.options?.audioInputName ??+ "No Audio"}+ </span>+ );+ }}</KSelect.Value><TargetSelectInfoPillvalue={props.options?.audioInputName ?? null}diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.tsindex ce4ae1e38..a56762af4 100644--- a/apps/desktop/src/utils/queries.ts+++ b/apps/desktop/src/utils/queries.ts@@ -56,6 +56,8 @@ export const listAudioDevices = queryOptions({},reconcile: "name",refetchInterval: 1000,+ gcTime: 0,+ staleTime: 0});export const getPermissions = queryOptions({