From a933e08e5f4bbb19600db70758cf362010ef73ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 12 Jun 2021 18:13:28 +0200 Subject: [PATCH] Also turn off camera when hiding sidebar 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 11e1bb1dfb..fa21a322db 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -431,7 +431,15 @@ export default class CallView extends React.Component { } private onToggleSidebar = () => { - this.setState({ sidebarShown: !this.state.sidebarShown }); + let vidMuted = this.state.vidMuted; + if (this.state.screensharing) { + vidMuted = this.state.sidebarShown; + this.props.call.setLocalVideoMuted(vidMuted); + } + this.setState({ + vidMuted: vidMuted, + sidebarShown: !this.state.sidebarShown, + }); } private renderCallControls(): JSX.Element {