Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🐛(frontend) prevent state updates when device selection unchanged

lebaudantoinea83afdbb0cbc
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Device/SelectDevice.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Device/SelectDevice.tsx
index 1e16a35f..6dcbea59 100644
--- a/src/frontend/src/features/rooms/livekit/components/controls/Device/SelectDevice.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/controls/Device/SelectDevice.tsx
@@ -58,6 +58,8 @@ const SelectDevicePermissions = <T extends string | number>({
setActiveMediaDevice(items[0].value)
}, [items, onSubmit, kind, setActiveMediaDevice, activeDeviceId])
+ const selectedKey = id || activeDeviceId
+
return (
<Select
aria-label={t(`${kind}.choose`)}
@@ -66,8 +68,9 @@ const SelectDevicePermissions = <T extends string | number>({
items={items}
iconComponent={iconComponent}
placeholder={items.length === 0 ? t('loading') : t('select')}
- selectedKey={id || activeDeviceId}
+ selectedKey={selectedKey}
onSelectionChange={(key) => {
+ if (key === selectedKey) return
onSubmit?.(key as string)
setActiveMediaDevice(key as string)
}}