diff --git a/src/components/views/elements/DesktopCapturerSourcePicker.tsx b/src/components/views/elements/DesktopCapturerSourcePicker.tsx index 7197602fa4..6ae465c362 100644 --- a/src/components/views/elements/DesktopCapturerSourcePicker.tsx +++ b/src/components/views/elements/DesktopCapturerSourcePicker.tsx @@ -84,14 +84,12 @@ export default class DesktopCapturerSourcePicker extends React.Component< }; } - componentDidMount() { + async componentDidMount() { // setInterval() first waits and then executes, therefore // we call getDesktopCapturerSources() here without any delay. // Otherwise the dialog would be left empty for some time. - getDesktopCapturerSources().then((result) => { - this.setState({ - sources: result, - }); + this.setState({ + sources: await getDesktopCapturerSources(), }); // We update the sources every 500ms to get newer thumbnails