mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
fix: prevent sending posts when no text was entered, and no other media is attached
fixes #30512
This commit is contained in:
parent
d326ad0ed9
commit
70a1f3701a
1 changed files with 2 additions and 2 deletions
|
@ -104,9 +104,9 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
canSubmit = () => {
|
||||
const { isSubmitting, isChangingUpload, isUploading, anyMedia, maxChars } = this.props;
|
||||
const fulltext = this.getFulltextForCharacterCounting();
|
||||
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
|
||||
const hasNoTextContent = fulltext.trim().length === 0;
|
||||
|
||||
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (isOnlyWhitespace && !anyMedia));
|
||||
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (hasNoTextContent && !anyMedia));
|
||||
};
|
||||
|
||||
handleSubmit = (e) => {
|
||||
|
|
Loading…
Reference in a new issue