From c2470acb2f19c1834c8a99b1e9f1da43304bec87 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 22 Jun 2018 00:44:23 +0300 Subject: fix thread refreshing --- vnext/src/components/Thread.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'vnext') diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index d53617b2..7464ca7f 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -14,9 +14,9 @@ import { format } from '../utils/embed'; export default class Thread extends React.Component { constructor(props) { super(props); - const { msg } = this.props.location.state || {} + const { msg } = (this.props.location.state || {}); this.state = { - msg: msg, + msg: msg || {}, replies: [], active: 0 }; @@ -55,7 +55,7 @@ export default class Thread extends React.Component { }); } loaded() { - return (this.state.replies && this.state.replies.length > 0) || ( 'mid' in this.state.msg && !('replies' in this.state.msg)); + return (this.state.replies && this.state.replies.length > 0) || ('mid' in this.state.msg && !('replies' in this.state.msg)); } setActive(msg, event) { this.setState({ @@ -87,7 +87,7 @@ export default class Thread extends React.Component {
= 0) }}>