mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-28 00:43:41 +01:00
Merge pull request #410 from ThibG/glitch-soc/fixes/compose-disable
[Glitch] Fix: Prevent submission using same logic as submit button disabling
This commit is contained in:
commit
1f5bdd8445
1 changed files with 8 additions and 0 deletions
|
@ -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 a new issue