diff --git a/apps/desktop/src/autofill/services/desktop-autofill.service.ts b/apps/desktop/src/autofill/services/desktop-autofill.service.ts index 22ba64d4d76..a104a036bda 100644 --- a/apps/desktop/src/autofill/services/desktop-autofill.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autofill.service.ts @@ -60,10 +60,6 @@ export class DesktopAutofillService implements OnDestroy { .pipe( distinctUntilChanged(), switchMap((enabled) => { - /* if (!enabled) { - return EMPTY; - } */ - return this.accountService.activeAccount$.pipe( map((account) => account?.id), filter((userId): userId is UserId => userId != null), diff --git a/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts b/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts index 470af76ec7f..2b65c32018a 100644 --- a/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts +++ b/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts @@ -160,7 +160,6 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi this.rpId.pipe( filter((id) => id != null), take(1), - timeout(5000), // 5 seconds timeout ), ); } diff --git a/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts b/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts index d5f3ae4d815..5e166e770b4 100644 --- a/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts +++ b/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts @@ -7,6 +7,7 @@ import { JslibModule } from "@bitwarden/angular/jslib.module"; import { BitwardenShield } from "@bitwarden/auth/angular"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { DomainSettingsService } from "@bitwarden/common/autofill/services/domain-settings.service"; +import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { @@ -22,14 +23,12 @@ import { BitIconButtonComponent, } from "@bitwarden/components"; import { PasswordRepromptService } from "@bitwarden/vault"; -// import { SearchComponent } from "@bitwarden/components/src/search/search.component"; import { DesktopFido2UserInterfaceService, DesktopFido2UserInterfaceSession, } from "../../../autofill/services/desktop-fido2-user-interface.service"; import { DesktopSettingsService } from "../../../platform/services/desktop-settings.service"; -// import { AnchorLinkDirective } from "../../../../../libs/components/src/link/link.directive"; @Component({ standalone: true, @@ -46,7 +45,6 @@ import { DesktopSettingsService } from "../../../platform/services/desktop-setti SectionComponent, ItemModule, BadgeModule, - // SearchComponent, ], templateUrl: "fido2-create.component.html", }) @@ -63,6 +61,7 @@ export class Fido2CreateComponent implements OnInit { private readonly cipherService: CipherService, private readonly dialogService: DialogService, private readonly domainSettingsService: DomainSettingsService, + private readonly logService: LogService, private readonly passwordRepromptService: PasswordRepromptService, private readonly router: Router, ) {} @@ -92,9 +91,7 @@ export class Fido2CreateComponent implements OnInit { }); this.ciphersSubject.next(relevantCiphers); }) - .catch(() => { - // console.error(err); - }); + .catch((error) => this.logService.error(error)); } async addPasskeyToCipher(cipher: CipherView) { diff --git a/apps/desktop/src/modal/passkeys/fido2-vault.component.ts b/apps/desktop/src/modal/passkeys/fido2-vault.component.ts index 43ac2e8304a..0c5061befa7 100644 --- a/apps/desktop/src/modal/passkeys/fido2-vault.component.ts +++ b/apps/desktop/src/modal/passkeys/fido2-vault.component.ts @@ -1,11 +1,13 @@ import { CommonModule } from "@angular/common"; import { Component, OnInit, OnDestroy } from "@angular/core"; +import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { RouterModule, Router } from "@angular/router"; import { firstValueFrom, map, BehaviorSubject, Observable } from "rxjs"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { BitwardenShield } from "@bitwarden/auth/angular"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; +import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { CipherRepromptType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; @@ -59,6 +61,7 @@ export class Fido2VaultComponent implements OnInit, OnDestroy { private readonly fido2UserInterfaceService: DesktopFido2UserInterfaceService, private readonly cipherService: CipherService, private readonly accountService: AccountService, + private readonly logService: LogService, private readonly passwordRepromptService: PasswordRepromptService, private readonly router: Router, ) {} @@ -71,16 +74,13 @@ export class Fido2VaultComponent implements OnInit, OnDestroy { this.session = this.fido2UserInterfaceService.getCurrentSession(); this.cipherIds$ = this.session?.availableCipherIds$; - // eslint-disable-next-line rxjs-angular/prefer-takeuntil - this.cipherIds$.subscribe((cipherIds) => { + this.cipherIds$.pipe(takeUntilDestroyed()).subscribe((cipherIds) => { this.cipherService .getAllDecryptedForIds(activeUserId, cipherIds || []) .then((ciphers) => { this.ciphersSubject.next(ciphers); }) - .catch(() => { - // console.error(err); - }); + .catch((error) => this.logService.error(error)); }); }