mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-26 08:51:32 +02:00
Reply; delay call to onWidgetLoad until after async setState completes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
0d6fc9bd3a
commit
4c08c51044
@ -82,7 +82,6 @@ export default class Reply extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadNextEvent() {
|
async loadNextEvent() {
|
||||||
this.props.onWidgetLoad();
|
|
||||||
const ev = this.state.events[0];
|
const ev = this.state.events[0];
|
||||||
const inReplyTo = Reply.getInReplyTo(ev);
|
const inReplyTo = Reply.getInReplyTo(ev);
|
||||||
|
|
||||||
@ -90,7 +89,7 @@ export default class Reply extends React.Component {
|
|||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
}, this.props.onWidgetLoad);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,9 +97,9 @@ export default class Reply extends React.Component {
|
|||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
|
|
||||||
if (loadedEv) {
|
if (loadedEv) {
|
||||||
this.setState({loadedEv});
|
this.setState({loadedEv}, this.props.onWidgetLoad);
|
||||||
} else {
|
} else {
|
||||||
this.setState({err: true});
|
this.setState({err: true}, this.props.onWidgetLoad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user