From 00f14c98143c0511c85a8b4a7d87f28fca970c43 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 6 Sep 2023 11:45:01 +0100 Subject: [PATCH 1/2] Fix the mute icon being incorrect when using PTT We were manipulating the participant's mute state directly for some reason, just for setting the mute state directly, which bypased the mutestates hook. --- src/room/InCallView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 1d3701bc..9bb2a4d9 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -190,7 +190,8 @@ export function InCallView({ containerRef1, toggleMicrophone, toggleCamera, - async (muted) => await localParticipant.setMicrophoneEnabled(!muted) + (muted) => + muteStates?.audio?.setEnabled && muteStates.audio.setEnabled(!muted) ); const onDisconnected = useCallback( From 38bb2895db59f25517eec9692eed72ae95f52436 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 7 Sep 2023 13:16:40 +0100 Subject: [PATCH 2/2] Tidier syntax Co-authored-by: Robin --- src/room/InCallView.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 9bb2a4d9..1eeafece 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -190,8 +190,7 @@ export function InCallView({ containerRef1, toggleMicrophone, toggleCamera, - (muted) => - muteStates?.audio?.setEnabled && muteStates.audio.setEnabled(!muted) + (muted) => muteStates.audio.setEnabled?.(!muted) ); const onDisconnected = useCallback(