FIX: Loading state persists after bad card entered (#22)

* FIX: Loading state persists after bad card entered

If a bad card number was entered and the subscribe button clicked, the
subscription button still disappeared and subscribing was not possible
without refreshing the page.

* UX: Add missing tooltip

* DEV: Ignore gems directory for local rubocop runs
This commit is contained in:
Justin DiRose 2020-10-19 20:54:30 -05:00 committed by GitHub
parent 55e6accb9c
commit e13221279d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View File

@ -1,2 +1,5 @@
AllCops:
Exclude:
- 'gems/**/*'
inherit_gem:
rubocop-discourse: default.yml

View File

@ -5,6 +5,7 @@ GIT
translations-manager (0.6)
GEM
remote: https://rubygems.org/
specs:
ast (2.4.1)
parallel (1.19.2)

View File

@ -25,6 +25,7 @@ export default Controller.extend({
createSubscription(plan) {
return this.stripe.createToken(this.get("cardElement")).then((result) => {
if (result.error) {
this.set("loading", false);
return result;
} else {
const customer = Customer.create({ source: result.token.id });

View File

@ -9,6 +9,9 @@ en:
errors:
discourse_patrons_amount_must_be_currency: "Currency amounts must be currencies without dollar symbol (eg 1.50)"
js:
filters:
subscribe:
help: Support this site by subscribing
discourse_subscriptions:
title: Discourse Subscriptions
admin_navigation: Subscriptions