From 0725013481e38e42b43aa92434ad0d78156a3dac Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Thu, 12 Mar 2020 22:35:53 +0300 Subject: [PATCH] Hide error message after login --- frontend/app/components/comment-form/comment-form.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/app/components/comment-form/comment-form.tsx b/frontend/app/components/comment-form/comment-form.tsx index a3738e41..1d0c16a8 100644 --- a/frontend/app/components/comment-form/comment-form.tsx +++ b/frontend/app/components/comment-form/comment-form.tsx @@ -140,6 +140,12 @@ export class CommentForm extends Component { 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) {