From ca766df598ba5594e8512dd3c56e677119f28a79 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 27 Apr 2018 11:32:04 +0100 Subject: [PATCH] call onWidgetLoad on componentDidUpdate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/elements/ReplyThread.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/views/elements/ReplyThread.js b/src/components/views/elements/ReplyThread.js index 1e23dfdc8a..d6d6c9fb44 100644 --- a/src/components/views/elements/ReplyThread.js +++ b/src/components/views/elements/ReplyThread.js @@ -65,6 +65,10 @@ export default class ReplyThread extends React.Component { this.initialize(); } + componentDidUpdate() { + this.props.onWidgetLoad(); + } + componentWillUnmount() { this.unmounted = true; } @@ -105,7 +109,7 @@ export default class ReplyThread extends React.Component { if (!inReplyTo) { this.setState({ loading: false, - }, this.props.onWidgetLoad); + }); return; } @@ -113,9 +117,9 @@ export default class ReplyThread extends React.Component { if (this.unmounted) return; if (loadedEv) { - this.setState({loadedEv}, this.props.onWidgetLoad); + this.setState({loadedEv}); } else { - this.setState({err: true}, this.props.onWidgetLoad); + this.setState({err: true}); } }