From 2f966d09ca81ca9499bb9d4a7ec9b0e2354f16b2 Mon Sep 17 00:00:00 2001 From: Serge Adamovich Date: Sun, 19 Apr 2020 20:12:44 +0300 Subject: [PATCH] Fix work with message in onDrop method --- frontend/app/components/comment-form/comment-form.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/comment-form/comment-form.tsx b/frontend/app/components/comment-form/comment-form.tsx index 3f5242d6..d8c1330b 100644 --- a/frontend/app/components/comment-form/comment-form.tsx +++ b/frontend/app/components/comment-form/comment-form.tsx @@ -281,11 +281,10 @@ export class CommentForm extends Component { onDrop(e: DragEvent) { const isAnonymous = this.props.user && isUserAnonymous(this.props.user); if (!this.props.user || isAnonymous) { + const message = isAnonymous ? messages.anonymousUploadingDisabled : messages.unauthorizedUploadingDisabled; this.setState({ isErrorShown: true, - errorMessage: this.props.intl.formatMessage( - messages[isAnonymous ? 'anonymousUploadingDisabled' : 'unauthorizedUploadingDisabled'] - ), + errorMessage: this.props.intl.formatMessage(message), }); e.preventDefault(); return;