Skip to content

Commit

Permalink
fix: 🐛 Voice: Fixed green ring still showing after mic is muted
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Jul 12, 2023
1 parent a2d1a4b commit ba6f6aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/chat-api/store/useVoiceUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ const onStream = (voiceUser: RawVoice, stream: MediaStream) => {
stream.onremovetrack = () => {
setVoiceUsers(voiceUser.channelId, voiceUser.userId, {
[streamType]: null,
voiceActivity: false
})
stream.onremovetrack = null;
}
Expand Down Expand Up @@ -292,10 +293,12 @@ const toggleMic = async () => {
sendStreamToPeer(stream, 'audio')
return;
}
const account = useAccount();
localStreams.vadStream?.getAudioTracks()[0].stop();
localStreams.vad?.destroy();
stopStream(localStreams.audioStream!);
setLocalStreams({audioStream: null})
setLocalStreams({audioStream: null});
setVoiceUsers(currentVoiceChannelId()!, account.user()?.id!, {voiceActivity: false});
}


Expand Down

0 comments on commit ba6f6aa

Please sign in to comment.