Don't use a callback in setScreensharingEnabled()

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-09-01 18:03:15 +02:00
parent f19030bcfa
commit d0b95b7d3d
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
1 changed files with 8 additions and 8 deletions

View File

@ -273,14 +273,14 @@ export default class CallView extends React.Component<IProps, IState> {
};
private onScreenshareClick = async (): Promise<void> => {
const isScreensharing = await this.props.call.setScreensharingEnabled(
!this.state.screensharing,
async (): Promise<DesktopCapturerSource> => {
let isScreensharing;
if (this.state.screensharing) {
isScreensharing = await this.props.call.setScreensharingEnabled(false);
} else {
const { finished } = Modal.createDialog(DesktopCapturerSourcePicker);
const [source] = await finished;
return source;
},
);
isScreensharing = await this.props.call.setScreensharingEnabled(true, source);
}
this.setState({
sidebarShown: true,