Skip to content

Lock review buttons after clicking#1306

Merged
sindresorhus merged 4 commits into
refined-github:masterfrom
rdev:master
May 19, 2018
Merged

Lock review buttons after clicking#1306
sindresorhus merged 4 commits into
refined-github:masterfrom
rdev:master

Conversation

@rdev
Copy link
Copy Markdown
Contributor

@rdev rdev commented May 8, 2018

I've been using refined-github for some time and I'm loving it so far!
I found an issue with review buttons. Due to how it currently works, it's possible to accidentally double click a button which will lead to double submission (or however many times you manage to click it until the page reloads):

screen shot 2018-05-08 at 12 11 23 pm

This PR adds locking to the review buttons after one of them was clicked:

gif

Copy link
Copy Markdown
Contributor

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's good. I've also recently ran into this.


// To avoid double submit
const reviewButtons = document.querySelectorAll('#submit-review .form-actions button');
reviewButtons.forEach(button => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a for-of loop

Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing

Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test

@vanniktech

This comment has been minimized.

@sindresorhus sindresorhus merged commit e4d8dd2 into refined-github:master May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants