This commit is contained in:
mplorentz
2026-04-02 15:27:50 -04:00
committed by hodlbod
parent 0ef6052820
commit 617b5c9fca
@@ -5,6 +5,7 @@
import ModalBody from "@lib/components/ModalBody.svelte" import ModalBody from "@lib/components/ModalBody.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte" import ModalFooter from "@lib/components/ModalFooter.svelte"
import ModalHeader from "@lib/components/ModalHeader.svelte" import ModalHeader from "@lib/components/ModalHeader.svelte"
import ModalSubtitle from "@lib/components/ModalSubtitle.svelte"
import ModalTitle from "@lib/components/ModalTitle.svelte" import ModalTitle from "@lib/components/ModalTitle.svelte"
import { import {
currentVoiceSession, currentVoiceSession,
@@ -41,16 +42,9 @@
} }
$effect(() => { $effect(() => {
void loadDevices() loadDevices()
const md = navigator.mediaDevices navigator.mediaDevices?.addEventListener?.("devicechange", loadDevices)
if (!md?.addEventListener) return return () => navigator.mediaDevices?.removeEventListener?.("devicechange", loadDevices)
const onDeviceChange = () => {
void loadDevices()
}
md.addEventListener("devicechange", onDeviceChange)
return () => {
md.removeEventListener("devicechange", onDeviceChange)
}
}) })
$effect(() => { $effect(() => {
@@ -83,8 +77,8 @@
<ModalBody> <ModalBody>
<ModalHeader> <ModalHeader>
<ModalTitle>Audio settings</ModalTitle> <ModalTitle>Audio settings</ModalTitle>
<ModalSubtitle>Choose microphone and speaker for this call.</ModalSubtitle>
</ModalHeader> </ModalHeader>
<p class="text-sm opacity-80">Choose microphone and speaker for this call.</p>
<div class="flex flex-col gap-4 pt-2"> <div class="flex flex-col gap-4 pt-2">
<FieldInline> <FieldInline>
{#snippet label()} {#snippet label()}
@@ -129,6 +123,6 @@
</div> </div>
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button class="btn btn-primary" onclick={onDone}>Done</Button> <Button class="btn btn-primary w-full" onclick={onDone}>Done</Button>
</ModalFooter> </ModalFooter>
</Modal> </Modal>