1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

[PM-2417] Update LoginApprovalComponent on Desktop (#6751)

* [PM-2417] convert modal to dialog service

* code format

* [PM-2417] Fix title

* [PM-2417] Remove unnecessary class

* Updated to use a local reference for the dialog.

* Changes to clarify the method naming

* More cleanup with Will.

* Removed unused style

---------

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
This commit is contained in:
André Bispo
2024-01-05 19:46:57 +00:00
committed by GitHub
parent 167648e213
commit 2a338319ea
4 changed files with 89 additions and 84 deletions

View File

@@ -399,7 +399,11 @@ export class AppComponent implements OnInit, OnDestroy {
break;
case "openLoginApproval":
if (message.notificationId != null) {
await this.openLoginApproval(message.notificationId);
this.dialogService.closeAll();
const dialogRef = LoginApprovalComponent.open(this.dialogService, {
notificationId: message.notificationId,
});
await firstValueFrom(dialogRef.closed);
}
break;
case "redrawMenu":
@@ -473,19 +477,6 @@ export class AppComponent implements OnInit, OnDestroy {
});
}
async openLoginApproval(notificationId: string) {
this.modalService.closeAll();
this.modal = await this.modalService.open(LoginApprovalComponent, {
data: { notificationId: notificationId },
});
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
this.modal.onClosed.subscribe(() => {
this.modal = null;
});
}
private async updateAppMenu() {
let updateRequest: MenuUpdateRequest;
const stateAccounts = await firstValueFrom(this.stateService.accounts$);