mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Derive mute state from props
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
0c55a6c5bf
commit
ed148de567
1 changed files with 7 additions and 0 deletions
|
@ -73,6 +73,13 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue