1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-10 05:30:01 +00:00

Simplify updateCredential method

This commit is contained in:
Jeffrey Holland
2025-03-25 11:18:15 +01:00
parent 561faab363
commit abd76360ea

View File

@@ -295,11 +295,16 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi
async updateCredential(cipher: CipherView): Promise<void> {
this.logService.warning("updateCredential");
const activeUserId = await firstValueFrom(
this.accountService.activeAccount$.pipe(map((a) => a?.id)),
await firstValueFrom(
this.accountService.activeAccount$.pipe(
map(async (a) => {
if (a) {
const encCipher = await this.cipherService.encrypt(cipher, a.id);
await this.cipherService.updateWithServer(encCipher);
}
}),
),
);
const encCipher = await this.cipherService.encrypt(cipher, activeUserId);
await this.cipherService.updateWithServer(encCipher);
}
async informExcludedCredential(existingCipherIds: string[]): Promise<void> {