OffTopic checkbox should follow state

This commit is contained in:
Chi Vinh Le
2017-09-05 17:21:11 +07:00
parent 2564aa98bb
commit 345d183bc4
@@ -29,12 +29,13 @@ export default class OffTopicCheckbox extends React.Component {
}
render() {
const checked = this.props.tags.indexOf(this.label) >= 0;
return (
<div className={styles.offTopic}>
{
!this.props.isReply ? (
<label className={styles.offTopicLabel}>
<input type="checkbox" onChange={this.handleChange}/>
<input type="checkbox" onChange={this.handleChange} checked={checked}/>
{t('off_topic')}
</label>
) : null