From ed148de5679f0fca6f20453dc5a8fcbdce32a19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 12 Jun 2021 12:16:52 +0200 Subject: [PATCH] Derive mute state from props MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/voip/VideoFeed.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/views/voip/VideoFeed.tsx b/src/components/views/voip/VideoFeed.tsx index 8ed4a4a44c..b1b272c0a2 100644 --- a/src/components/views/voip/VideoFeed.tsx +++ b/src/components/views/voip/VideoFeed.tsx @@ -73,6 +73,13 @@ export default class VideoFeed extends React.Component { this.updateFeed(prevProps.feed, this.props.feed); } + static getDerivedStateFromProps(props: IProps) { + return { + audioMuted: props.feed.isAudioMuted(), + videoMuted: props.feed.isVideoMuted(), + }; + } + private updateFeed(oldFeed: CallFeed, newFeed: CallFeed) { if (oldFeed === newFeed) return;