From a2977f5b17c0c3ecf0b6fbd86dfefcb8600f1a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 5 Aug 2021 16:50:03 +0200 Subject: [PATCH] Update muting to work with the js-sdk call upgrade changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/voip/CallView.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 17fda93921..11206602c7 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -214,6 +214,8 @@ export default class CallView extends React.Component { this.setState({ primaryFeed: primary, secondaryFeeds: secondary, + micMuted: this.props.call.isMicrophoneMuted(), + vidMuted: this.props.call.isLocalVideoMuted(), }); }; @@ -258,18 +260,14 @@ export default class CallView extends React.Component { return { primary, secondary }; } - private onMicMuteClick = (): void => { + private onMicMuteClick = async (): Promise => { const newVal = !this.state.micMuted; - - this.props.call.setMicrophoneMuted(newVal); - this.setState({ micMuted: newVal }); + this.setState({ micMuted: await this.props.call.setMicrophoneMuted(newVal) }); }; - private onVidMuteClick = (): void => { + private onVidMuteClick = async (): Promise => { const newVal = !this.state.vidMuted; - - this.props.call.setLocalVideoMuted(newVal); - this.setState({ vidMuted: newVal }); + this.setState({ vidMuted: await this.props.call.setLocalVideoMuted(newVal) }); }; private onScreenshareClick = async (): Promise => {