From 52468d17b99f8b7db8f5dc5395f92318391b18f8 Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Sat, 27 May 2017 16:54:14 +1000 Subject: [PATCH] disable button earlier to prevent double clicks --- assets/javascripts/discourse/components/stripe-card.js.es6 | 4 +++- plugin.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/components/stripe-card.js.es6 b/assets/javascripts/discourse/components/stripe-card.js.es6 index 4772c3d..1841cad 100644 --- a/assets/javascripts/discourse/components/stripe-card.js.es6 +++ b/assets/javascripts/discourse/components/stripe-card.js.es6 @@ -61,15 +61,17 @@ export default Ember.Component.extend({ submitStripeCard() { let self = this; + self.set('transactionInProgress', true); + this.get('stripe').createToken(this.get('card')).then(data => { self.set('result', []); if (data.error) { self.set('result', data.error.message); + self.set('transactionInProgress', false); } else { - self.set('transactionInProgress', true); let params = { stripeToken: data.token.id, diff --git a/plugin.rb b/plugin.rb index 750bf34..8d52d24 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,6 +1,6 @@ # name: discourse-donations # about: Integrating Discourse with Stripe for donations -# version: 2.3.0 +# version: 2.3.1 # url: https://github.com/choiceaustralia/discourse-donations # authors: Rimian Perkins