Don't use a callback in setScreensharingEnabled()
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
f19030bcfa
commit
d0b95b7d3d
1 changed files with 8 additions and 8 deletions
|
@ -273,14 +273,14 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
};
|
};
|
||||||
|
|
||||||
private onScreenshareClick = async (): Promise<void> => {
|
private onScreenshareClick = async (): Promise<void> => {
|
||||||
const isScreensharing = await this.props.call.setScreensharingEnabled(
|
let isScreensharing;
|
||||||
!this.state.screensharing,
|
if (this.state.screensharing) {
|
||||||
async (): Promise<DesktopCapturerSource> => {
|
isScreensharing = await this.props.call.setScreensharingEnabled(false);
|
||||||
const { finished } = Modal.createDialog(DesktopCapturerSourcePicker);
|
} else {
|
||||||
const [source] = await finished;
|
const { finished } = Modal.createDialog(DesktopCapturerSourcePicker);
|
||||||
return source;
|
const [source] = await finished;
|
||||||
},
|
isScreensharing = await this.props.call.setScreensharingEnabled(true, source);
|
||||||
);
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
sidebarShown: true,
|
sidebarShown: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue