aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Thread.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/components/Thread.js')
-rw-r--r--vnext/src/components/Thread.js8
1 files changed, 3 insertions, 5 deletions
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 ? (
<React.Fragment>
- {this.state.active === msg.rid || <Button onClick={this.setActive.bind(this, msg)}><Icon name="ei-envelope" size="s" />Reply</Button>}
+ {this.state.active === msg.rid || <Button onClick={() => this.setActive(msg)}><Icon name="ei-envelope" size="s" />Reply</Button>}
{this.state.active === msg.rid && <MessageInput data={msg} onSend={this.postComment} />}
</React.Fragment>
) : (