Merge pull request #410 from ThibG/glitch-soc/fixes/compose-disable

[Glitch] Fix: Prevent submission using same logic as submit button disabling
main
David Yip 7 years ago committed by GitHub
commit 1f5bdd8445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -150,6 +150,9 @@ const handlers = {
const {
onChangeText,
onSubmit,
isSubmitting,
isUploading,
anyMedia,
text,
} = this.props;
@ -159,6 +162,11 @@ const handlers = {
onChangeText(value);
}
// Submit disabled:
if (isSubmitting || isUploading || (!!text.length && !text.trim().length && !anyMedia)) {
return;
}
// Submits the status.
if (onSubmit) {
onSubmit();

Loading…
Cancel
Save