Merge pull request #5631 from SimonBrandner/avoid-delay-on-screen-share

Avoid delayed displaying of sources in source picker
pull/21833/head
Michael Telatynski 2021-02-09 12:26:29 +00:00 committed by GitHub
commit 59069f95e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -84,7 +84,14 @@ 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.
this.setState({
sources: await getDesktopCapturerSources(),
});
// We update the sources every 500ms to get newer thumbnails
this.interval = setInterval(async () => {
this.setState({