Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Update muting in calls to work with the js-sdk call upgrade changes #6547

Merged
merged 2 commits into from
Sep 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/components/views/voip/CallView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ export default class CallView extends React.Component<IProps, IState> {
this.setState({
primaryFeed: primary,
secondaryFeeds: secondary,
micMuted: this.props.call.isMicrophoneMuted(),
vidMuted: this.props.call.isLocalVideoMuted(),
});
};

Expand Down Expand Up @@ -258,18 +260,14 @@ export default class CallView extends React.Component<IProps, IState> {
return { primary, secondary };
}

private onMicMuteClick = (): void => {
private onMicMuteClick = async (): Promise<void> => {
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<void> => {
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<void> => {
Expand Down