1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
This commit is contained in:
Maximilian Ertl 2024-07-31 14:07:09 +00:00 committed by GitHub
commit 9a4059a1cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,9 +101,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) => {