mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
[Glitch] Fix: Prevent submission using same logic as submit button disabling.
Port 6a895e1ab3
to glitch-soc
This commit is contained in:
parent
eb39db7f93
commit
ca9f022a80
@ -150,6 +150,9 @@ const handlers = {
|
|||||||
const {
|
const {
|
||||||
onChangeText,
|
onChangeText,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
|
isSubmitting,
|
||||||
|
isUploading,
|
||||||
|
anyMedia,
|
||||||
text,
|
text,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
@ -159,6 +162,11 @@ const handlers = {
|
|||||||
onChangeText(value);
|
onChangeText(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Submit disabled:
|
||||||
|
if (isSubmitting || isUploading || (!!text.length && !text.trim().length && !anyMedia)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Submits the status.
|
// Submits the status.
|
||||||
if (onSubmit) {
|
if (onSubmit) {
|
||||||
onSubmit();
|
onSubmit();
|
||||||
|
Loading…
Reference in New Issue
Block a user