mirror of https://github.com/vector-im/riot-web
Avoid delayed displaying of sources
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
22dfa91631
commit
98e602f544
|
@ -85,6 +85,15 @@ export default class DesktopCapturerSourcePicker extends React.Component<
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
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,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// 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({
|
||||||
|
|
Loading…
Reference in New Issue