Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BB-453: Prevent multiple form submissions #446

Merged
merged 2 commits into from
Jun 8, 2020
Merged

Conversation

MonkeyDo
Copy link
Contributor

@MonkeyDo MonkeyDo commented Jun 8, 2020

Problem

A user can mash the submit button and the form will be submitted as many times as they clicked it before being redirected.
That's obviously an issue and resulted in a bunch of duplicates in the database.

Solution

Disable the submit button once submitted.
re-enable it if there was an error with the submission.

While I was in there, I also fixed a small issue introduced in #438 where a submission error message was not extracted properly from the response body following the replacement of superagent-bluebird-promise library with superagent itself.

Disable submit button once clicked
Introduced in PR#438 when replacing superagent-bluebird-promise
@coveralls
Copy link

coveralls commented Jun 8, 2020

Coverage Status

Coverage decreased (-0.03%) to 60.358% when pulling 6b31f71 on fix-form-submission into b2828e0 on master.

@MonkeyDo MonkeyDo merged commit 66a2790 into master Jun 8, 2020
@MonkeyDo MonkeyDo deleted the fix-form-submission branch June 8, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants