From b75a99e16b5370a71889be607389676388377a3a Mon Sep 17 00:00:00 2001 From: chr Date: Sun, 23 Jun 2019 13:58:33 -0700 Subject: Feature: 1024-character posts in server and client --- .../mastodon/features/compose/components/compose_form.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 8af806ec4..137a30506 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -96,7 +96,15 @@ class ComposeForm extends ImmutablePureComponent { this.props.onChange(this.autosuggestTextarea.textarea.value); } +<<<<<<< HEAD if (!this.canSubmit()) { +======= + // Submit disabled: + const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props; + const fulltext = [this.props.spoilerText, countableText(this.props.text)].join(''); + + if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > 1024 || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) { +>>>>>>> Feature: 1024-character posts in server and client return; } @@ -188,6 +196,11 @@ class ComposeForm extends ImmutablePureComponent { render () { const { intl, onPaste, showSearch } = this.props; const disabled = this.props.isSubmitting; +<<<<<<< HEAD +======= + const text = [this.props.spoilerText, countableText(this.props.text)].join(''); + const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > 1024 || (text.length !== 0 && text.trim().length === 0 && !anyMedia); +>>>>>>> Feature: 1024-character posts in server and client let publishText = ''; if (this.props.privacy === 'private' || this.props.privacy === 'direct') { @@ -249,7 +262,7 @@ class ComposeForm extends ImmutablePureComponent { -
+
-- cgit