Skip to content

Commit

Permalink
Merge branch '2471-loading-payment-error' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Dec 20, 2023
2 parents b201865 + cf13390 commit 65b65ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/app/profile/payment-methods/payment-methods.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ class PaymentMethodsController {
},
error => {
this.loading = false
this.loadingError = true
this.$log.error('Error loading payment methods', error)
if (error.status === 500) {
this.loadingError = 'authentication'
} else {
this.loadingError = true
}
}
)
}
Expand Down
7 changes: 5 additions & 2 deletions src/app/profile/payment-methods/payment-methods.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ <h3 translate>Your Payment Methods</h3>
<loading ng-if="$ctrl.loading" class="mb">
<translate>Loading payment methods...</translate>
</loading>
<div class="alert alert-danger" role="alert" ng-if="$ctrl.loadingError" translate>
There was an error loading your payment methods. You may <a href="" ng-click="$ctrl.loadPaymentMethods()">try again</a>.
<div class="alert alert-danger" role="alert" ng-if="$ctrl.loadingError === true">
<span translate>There was an error loading your payment methods. You may</span> <a href="" ng-click="$ctrl.loadPaymentMethods()" translate>try again</a>.
</div>
<div class="alert alert-danger" role="alert" ng-if="$ctrl.loadingError === 'authentication'" translate>
There was an error loading your payment methods. Please log out and log in again.
</div>
<div class="alert alert-warning" role="alert" ng-if="!$ctrl.loading && !$ctrl.loadingError && $ctrl.paymentMethods.length === 0" translate>
You haven't added any payment methods. Feel free to add one.
Expand Down

0 comments on commit 65b65ab

Please sign in to comment.