From aa8362c470765606ade4b89194b80c932e4814c3 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 22 Aug 2025 11:30:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8(frontend)=20clarify=20video=20togg?= =?UTF-8?q?le=20naming=20and=20improve=20typing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhance toggle naming in video controls to explicitly indicate special processor handling functionality and improve toggleProps TypeScript typing. Makes code more self-documenting by clearly identifying processor-aware toggle behavior while strengthening type safety --- .../livekit/components/controls/Device/ToggleDevice.tsx | 2 +- .../components/controls/Device/VideoDeviceControl.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Device/ToggleDevice.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Device/ToggleDevice.tsx index 0c4b96c1..c71c887d 100644 --- a/src/frontend/src/features/rooms/livekit/components/controls/Device/ToggleDevice.tsx +++ b/src/frontend/src/features/rooms/livekit/components/controls/Device/ToggleDevice.tsx @@ -30,7 +30,7 @@ export type ToggleDeviceProps = { toggle: ( forceState?: boolean, captureOptions?: CaptureOptionsBySource - ) => Promise | void + ) => Promise context?: 'room' | 'join' kind: 'audioinput' | 'videoinput' toggleButtonProps?: Partial diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Device/VideoDeviceControl.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Device/VideoDeviceControl.tsx index 5c026ac4..e34d5186 100644 --- a/src/frontend/src/features/rooms/livekit/components/controls/Device/VideoDeviceControl.tsx +++ b/src/frontend/src/features/rooms/livekit/components/controls/Device/VideoDeviceControl.tsx @@ -67,7 +67,7 @@ export const VideoDeviceControl = ({ const kind = 'videoinput' const cannotUseDevice = useCannotUseDevice(kind) - const toggle = () => { + const toggleWithProcessor = async () => { /** * We need to make sure that we apply the in-memory processor when re-enabling the camera. * Before, we had the following bug: @@ -89,7 +89,7 @@ export const VideoDeviceControl = ({ captureOptions: VideoCaptureOptions ) => Promise - toggle(!trackProps.enabled, { + await toggle(!trackProps.enabled, { processor: processor, } as VideoCaptureOptions) } @@ -106,7 +106,7 @@ export const VideoDeviceControl = ({