From 28679bfba2d4160cd54fe368e5412aa622cd8c6e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 25 Jun 2018 13:02:30 +0300 Subject: transform-class-properties --- vnext/src/components/Thread.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'vnext/src/components/Thread.js') diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index 5ff91346..17c5b55c 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -21,8 +21,6 @@ export default class Thread extends React.Component { replies: [], active: 0 }; - this.loaded = this.loaded.bind(this); - this.postComment = this.postComment.bind(this); } componentDidMount() { document.body.scrollTop = 0; @@ -55,7 +53,7 @@ export default class Thread extends React.Component { console.log(ex); }); } - loaded() { + loaded = () => { return (this.state.replies && this.state.replies.length > 0) || ('mid' in this.state.msg && !('replies' in this.state.msg)); } setActive(msg, event) { @@ -63,7 +61,7 @@ export default class Thread extends React.Component { active: msg.rid || 0 }) } - postComment(template) { + postComment = (template) => { const url = `https://api.juick.com/comment?hash=${this.props.visitor.hash}`; let form = new FormData(); form.append('mid', template.mid); @@ -150,7 +148,7 @@ export default class Thread extends React.Component { { this.props.visitor.uid > 0 ? ( - {this.state.active === msg.rid || } + {this.state.active === msg.rid || } {this.state.active === msg.rid && } ) : ( -- cgit v1.2.3