Hide error message after login

This commit is contained in:
Pavel Mineev
2020-03-12 15:44:31 -05:00
committed by Umputun
parent 779839aeb4
commit 0725013481
@@ -140,6 +140,12 @@ export class CommentForm extends Component<Props, State> {
this.setState({ text: nextProps.value || '' });
this.props.autofocus && this.textAreaRef.current && this.textAreaRef.current.focus();
}
if (nextProps.user && !this.props.value) {
this.setState({
isErrorShown: false,
errorMessage: null,
});
}
}
shouldComponentUpdate(nextProps: Props, nextState: State) {