1
0
mirror of https://github.com/bitwarden/web synced 2026-01-08 03:23:29 +00:00

sca card failure warning

This commit is contained in:
Kyle Spearrin
2019-08-10 19:51:49 -04:00
parent 8bafbbd2ff
commit 7d76473580
3 changed files with 29 additions and 4 deletions

View File

@@ -6,6 +6,11 @@ import {
ViewChild,
} from '@angular/core';
import {
ActivatedRoute,
Router,
} from '@angular/router';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
@@ -36,7 +41,8 @@ export class AdjustStorageComponent {
formPromise: Promise<any>;
constructor(private apiService: ApiService, private i18nService: I18nService,
private analytics: Angulartics2, private toasterService: ToasterService) { }
private analytics: Angulartics2, private toasterService: ToasterService,
private router: Router, private activatedRoute: ActivatedRoute) { }
async submit() {
try {
@@ -68,7 +74,12 @@ export class AdjustStorageComponent {
this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });
this.onAdjusted.emit(this.storageAdjustment);
if (paymentFailed) {
// TOOD: go to billing page
this.toasterService.popAsync({
body: this.i18nService.t('couldNotChargeCardPayInvoice'),
type: 'warning',
timeout: 10000,
});
this.router.navigate(['../billing'], { relativeTo: this.activatedRoute });
} else {
this.toasterService.popAsync('success', null,
this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString()));