From 17972c0bf27c9b80836dbe663d8f50b7aab01c92 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 20 Jun 2018 17:57:33 +0300 Subject: push message to thread state --- vnext/src/components/Thread.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'vnext/src/components/Thread.js') diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index a1aaa837..a404cf57 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -13,8 +13,9 @@ import { format } from '../utils/embed'; export default class Thread extends React.Component { constructor(props) { super(props); + const { msg } = this.props.location.state || {} this.state = { - msg: {}, + msg: msg, replies: [], active: 0 }; @@ -53,7 +54,7 @@ export default class Thread extends React.Component { }); } loaded() { - return this.state.msg.mid; + return this.state.msg && this.state.msg.mid; } setActive(msg, event) { this.setState({ @@ -85,7 +86,7 @@ export default class Thread extends React.Component { { - this.loaded() && ( + this.loaded() ? (
{ @@ -165,6 +166,8 @@ export default class Thread extends React.Component { } + ) : ( + ) } -- cgit v1.2.3