From 636d29af9f216167d5493176fe545f048f35deac Mon Sep 17 00:00:00 2001 From: Benjamin Goering Date: Wed, 3 May 2017 19:41:29 -0700 Subject: [PATCH] When max char count is disabled, allow posting long comments in CommentBox --- client/coral-plugin-commentbox/CommentBox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index cd38aba1a..57ff7cf49 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -90,12 +90,12 @@ export class CommentForm extends React.Component { saveComment({body}); } render() { - const {maxCharCount, styles, saveCommentEnabled, buttonClass} = this.props; + const {maxCharCount, styles, saveCommentEnabled, buttonClass, charCountEnable} = this.props; const body = this.state.body; const length = body.length; const isNotValidLength = (length) => !length || (maxCharCount && length > maxCharCount); - const disablePostComment = isNotValidLength(length) || ! saveCommentEnabled({body}); + const disablePostComment = (charCountEnable && isNotValidLength(length)) || ! saveCommentEnabled({body}); return