From 49014d386cfd21d3434f376baa9c6b9ee0da62c6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 20 Jun 2018 22:15:36 +0300 Subject: correct loading flow --- vnext/src/components/Thread.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'vnext') diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index 2dab4250..ebbb1eec 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -54,7 +54,7 @@ export default class Thread extends React.Component { }); } loaded() { - return this.state.msg && this.state.msg.mid; + return (this.state.replies && this.state.replies.length > 0) || ( 'mid' in this.state.msg && !('replies' in this.state.msg)); } setActive(msg, event) { this.setState({ @@ -98,15 +98,15 @@ export default class Thread extends React.Component { { - this.loaded() ? ( - -
- { - this.props.visitor.uid > 0 && - - } -

{msg.replies && `Replies (${msg.replies})`}

-
+ +
+ { + this.props.visitor.uid > 0 && + + } +

{msg.replies && `Replies (${msg.replies})`}

+
+ {this.loaded() ? ( -
- ) : ( - - - - ) + ) : ( + + + + )} +
} ) -- cgit v1.2.3