This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
[Glitch] Fix: Prevent submission using same logic as submit button disabling.
Port
6a895e1ab3
to glitch-soc
closed-social-glitch-2
Thibaut Girka
6 years ago
parent
eb39db7f93
commit
ca9f022a80
1 changed files
with
8 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+8
-0
app/javascript/flavours/glitch/features/composer/index.js
+ 8
- 0
app/javascript/flavours/glitch/features/composer/index.js
View File
@ -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
(
)
;
Write
Preview
Loading…
Cancel
Save