1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Removing hanging promises, and adding a guard to projects routing (#8891)

* Removing hanging promises, and adding a guard to projects routing

* Additional logging

* adding tests

* Trying to get Jest tests working

* coltons suggested changes
This commit is contained in:
cd-bitwarden
2024-06-04 10:59:43 -04:00
committed by GitHub
parent ed7a57810e
commit 6fa12fea49
15 changed files with 321 additions and 63 deletions

View File

@@ -199,7 +199,7 @@ export class SecretDialogComponent implements OnInit {
return await this.projectService.create(this.data.organizationId, projectView);
}
protected openDeleteSecretDialog() {
protected async openDeleteSecretDialog() {
const secretListView: SecretListView[] = this.getSecretListView();
const dialogRef = this.dialogService.open<unknown, SecretDeleteOperation>(
@@ -212,9 +212,7 @@ export class SecretDialogComponent implements OnInit {
);
// If the secret is deleted, chain close this dialog after the delete dialog
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
lastValueFrom(dialogRef.closed).then(
await lastValueFrom(dialogRef.closed).then(
(closeData) => closeData !== undefined && this.dialogRef.close(),
);
}