diff --git a/src/room/usePTT.ts b/src/room/usePTT.ts index 0d8f106e..d84907ba 100644 --- a/src/room/usePTT.ts +++ b/src/room/usePTT.ts @@ -73,9 +73,9 @@ export const usePTT = ( playClip(PTTClipID.START_TALKING_REMOTE); } } else if ( - activeSpeakerFeed && + pttButtonHeld && activeSpeakerUserId === client.getUserId() && - activeSpeakerFeed.userId !== client.getUserId() + activeSpeakerFeed?.userId !== client.getUserId() ) { // We were talking but we've been cut off playClip(PTTClipID.BLOCKED); @@ -108,7 +108,7 @@ export const usePTT = ( ); } }; - }, [userMediaFeeds, activeSpeakerUserId, client, playClip]); + }, [userMediaFeeds, activeSpeakerUserId, client, playClip, pttButtonHeld]); const startTalking = useCallback(async () => { if (pttButtonHeld) return;