1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-29 12:55:21 +01:00

resolve the issue (#9000)

This commit is contained in:
cyprain-okeke 2024-05-01 22:00:10 +01:00 committed by GitHub
parent 4b42ff7171
commit 66d9ec19a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
import { Component } from "@angular/core"; import { Component } from "@angular/core";
import { ActivatedRoute } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
import { UserVerificationDialogComponent } from "@bitwarden/auth/angular"; import { UserVerificationDialogComponent } from "@bitwarden/auth/angular";
import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service";
@ -42,6 +42,7 @@ export class AccountComponent {
private dialogService: DialogService, private dialogService: DialogService,
private configService: ConfigService, private configService: ConfigService,
private providerApiService: ProviderApiServiceAbstraction, private providerApiService: ProviderApiServiceAbstraction,
private router: Router,
) {} ) {}
async ngOnInit() { async ngOnInit() {
@ -93,9 +94,8 @@ export class AccountComponent {
return; return;
} }
this.formPromise = this.providerApiService.deleteProvider(this.providerId);
try { try {
await this.formPromise; await this.providerApiService.deleteProvider(this.providerId);
this.platformUtilsService.showToast( this.platformUtilsService.showToast(
"success", "success",
this.i18nService.t("providerDeleted"), this.i18nService.t("providerDeleted"),
@ -104,7 +104,8 @@ export class AccountComponent {
} catch (e) { } catch (e) {
this.logService.error(e); this.logService.error(e);
} }
this.formPromise = null;
await this.router.navigate(["/"]);
} }
private async verifyUser(): Promise<boolean> { private async verifyUser(): Promise<boolean> {