1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

[PM-19032] Live Sync on Desktop (#13851)

* migrate the vault-items to an observables rather than async/promises

- this helps keep data in sync with the service state and avoids race conditions

* migrate the view component to an observables rather than async/promises

- this helps keep data in sync with the service state and avoids race conditions
This commit is contained in:
Nick Krantz
2025-03-19 16:01:19 -05:00
committed by GitHub
parent 29d6438a51
commit 18f84008c4
5 changed files with 135 additions and 98 deletions

View File

@@ -28,9 +28,6 @@ export class VaultItemsComponent extends BaseVaultItemsComponent {
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
searchBarService.searchText$.pipe(distinctUntilChanged()).subscribe((searchText) => {
this.searchText = searchText;
// 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
this.search(200);
});
}

View File

@@ -497,7 +497,6 @@ export class VaultComponent implements OnInit, OnDestroy {
this.action = "view";
await this.vaultItemsComponent.refresh();
await this.cipherService.clearCache(this.activeUserId);
await this.viewComponent.load();
this.go();
}

View File

@@ -120,9 +120,7 @@ export class ViewComponent extends BaseViewComponent implements OnInit, OnDestro
}
async ngOnChanges() {
await super.load();
if (this.cipher.decryptionFailure) {
if (this.cipher?.decryptionFailure) {
DecryptionFailureDialogComponent.open(this.dialogService, {
cipherIds: [this.cipherId as CipherId],
});