Skip to content
This repository was archived by the owner on Feb 11, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/mixins/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ var StripeMixin = {
return;
}
if (!window.grecaptcha) {
return setTimeout(() => {
setTimeout(() => {
this.expectRecaptcha(callback);
}, 100);
return;
Comment on lines +91 to +94
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? It doesn't appear to do anything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Strictly not necessary, it doesn't change the behaviour. But it's not good practice to have methods that sometimes return something (well undefined, so not much) and sometimes not, as some linters will tell you...

}

window.grecaptcha.ready(callback);
Expand All @@ -115,7 +116,9 @@ var StripeMixin = {
// This is a hack to get around the reCaptcha
// puzzle being shown at the top of the page.
window.scrollTo(0, 0);
this.expectRecaptcha(window.grecaptcha.execute);
this.expectRecaptcha(() => {
window.grecaptcha.execute();
});
},
stripeSubmit: function(reCaptchaToken) {
var success = this.stripeSuccess;
Expand Down