feat(voice): persist A/V device preferences in localStorage

This commit is contained in:
2026-07-09 12:36:33 -04:00
parent 19a3ea489b
commit d20c0da498
2 changed files with 48 additions and 0 deletions
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react';
import { useVoiceStore } from '../stores/voice.ts';
import { saveDevicePref } from '../stores/voice.ts';
interface Props {
onClose: () => void;
@@ -48,6 +49,7 @@ export function DeviceSettingsModal({ onClose }: Props) {
if (!room) return;
try {
await room.switchActiveDevice(kind, deviceId);
saveDevicePref(kind, deviceId);
if (kind === 'audioinput') setActiveAudioInput(deviceId);
if (kind === 'audiooutput') setActiveAudioOutput(deviceId);
if (kind === 'videoinput') setActiveVideoInput(deviceId);