You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Merge pull request #5631 from SimonBrandner/avoid-delay-on-screen-share
Avoid delayed displaying of sources in source picker
This commit is contained in:
@@ -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
|
// We update the sources every 500ms to get newer thumbnails
|
||||||
this.interval = setInterval(async () => {
|
this.interval = setInterval(async () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
Reference in New Issue
Block a user