mirror of
https://github.com/wassname/talk.git
synced 2026-07-31 12:50:48 +08:00
When max char count is disabled, allow posting long comments in CommentBox
This commit is contained in:
@@ -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 <div>
|
||||
<div className={`${name}-container`}>
|
||||
|
||||
Reference in New Issue
Block a user