🐛(frontend) fix audio device ID persistence from settings panel

Ensure user's audio device selection is properly saved to localStorage
when changed through settings to maintain preference across sessions.
This commit is contained in:
lebaudantoine
2025-06-24 19:17:10 +02:00
committed by aleb_the_flash
parent 4a18e188e4
commit 27a0128b2a

View File

@@ -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%',