From 66d9ec19a329fbb3e155a4660cc663fa53300038 Mon Sep 17 00:00:00 2001 From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Date: Wed, 1 May 2024 22:00:10 +0100 Subject: [PATCH] resolve the issue (#9000) --- .../providers/settings/account.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/settings/account.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/settings/account.component.ts index 70eb8af7ba..0dace2945e 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/settings/account.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/settings/account.component.ts @@ -1,5 +1,5 @@ import { Component } from "@angular/core"; -import { ActivatedRoute } from "@angular/router"; +import { ActivatedRoute, Router } from "@angular/router"; import { UserVerificationDialogComponent } from "@bitwarden/auth/angular"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; @@ -42,6 +42,7 @@ export class AccountComponent { private dialogService: DialogService, private configService: ConfigService, private providerApiService: ProviderApiServiceAbstraction, + private router: Router, ) {} async ngOnInit() { @@ -93,9 +94,8 @@ export class AccountComponent { return; } - this.formPromise = this.providerApiService.deleteProvider(this.providerId); try { - await this.formPromise; + await this.providerApiService.deleteProvider(this.providerId); this.platformUtilsService.showToast( "success", this.i18nService.t("providerDeleted"), @@ -104,7 +104,8 @@ export class AccountComponent { } catch (e) { this.logService.error(e); } - this.formPromise = null; + + await this.router.navigate(["/"]); } private async verifyUser(): Promise {