1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-02 17:53:41 +00:00

Fix type error

This commit is contained in:
Bernd Schoolmann
2025-10-27 17:29:00 +01:00
parent 9b8641d7aa
commit 3482268ccd

View File

@@ -91,12 +91,18 @@ export class Attachment extends Domain {
}
}
private async getKeyForDecryption(orgId: string | undefined, userId: UserId): Promise<OrgKey | UserKey | null> {
private async getKeyForDecryption(
orgId: string | undefined,
userId: UserId,
): Promise<OrgKey | UserKey | null> {
const keyService = Utils.getContainerService().getKeyService();
console.log("getKeyForDecryption", orgId, userId);
return orgId != null ? await firstValueFrom(keyService.orgKeys$(userId).pipe(
map((orgKeys) => orgKeys[orgId as OrganizationId] ?? null),
)) : await firstValueFrom(keyService.userKey$(userId));
return orgId != null
? await firstValueFrom(
keyService
.orgKeys$(userId)
.pipe(map((orgKeys) => (orgKeys ? (orgKeys[orgId as OrganizationId] ?? null) : null))),
)
: await firstValueFrom(keyService.userKey$(userId));
}
toAttachmentData(): AttachmentData {