From 27a0128b2a8e019f524fe44fc804a45ae9f3057e Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Tue, 24 Jun 2025 19:17:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20fix=20audio=20device?= =?UTF-8?q?=20ID=20persistence=20from=20settings=20panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure user's audio device selection is properly saved to localStorage when changed through settings to maintain preference across sessions. --- .../src/features/settings/components/tabs/AudioTab.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx index 9b7a1a78..1347b2ff 100644 --- a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx +++ b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx @@ -11,6 +11,7 @@ import { useTranslation } from 'react-i18next' import { SoundTester } from '@/components/SoundTester' import { HStack } from '@/styled-system/jsx' import { ActiveSpeaker } from '@/features/rooms/components/ActiveSpeaker' +import { usePersistentUserChoices } from '@/features/rooms/livekit/hooks/usePersistentUserChoices' import { ReactNode } from 'react' type RowWrapperProps = { @@ -60,6 +61,8 @@ export const AudioTab = ({ id }: AudioTabProps) => { const { t } = useTranslation('settings') const { localParticipant } = useRoomContext() + const { saveAudioInputDeviceId } = usePersistentUserChoices() + const isSpeaking = useIsSpeaking(localParticipant) const { @@ -116,7 +119,10 @@ export const AudioTab = ({ id }: AudioTabProps) => { defaultSelectedKey={ activeDeviceIdIn || getDefaultSelectedKey(itemsIn) } - onSelectionChange={(key) => setActiveMediaDeviceIn(key as string)} + onSelectionChange={(key) => { + setActiveMediaDeviceIn(key as string) + saveAudioInputDeviceId(key as string) + }} {...disabledProps} style={{ width: '100%',