mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 03:03:26 +00:00
Merge remote-tracking branch 'origin/main' into feature/passkey-provider
This commit is contained in:
@@ -125,6 +125,10 @@ describe("VaultPopupAutofillService", () => {
|
||||
});
|
||||
|
||||
it("should only fetch the current tab once when subscribed to multiple times", async () => {
|
||||
(BrowserApi.getTabFromCurrentWindow as jest.Mock).mockClear();
|
||||
|
||||
service.refreshCurrentTab();
|
||||
|
||||
const firstTracked = subscribeTo(service.currentAutofillTab$);
|
||||
const secondTracked = subscribeTo(service.currentAutofillTab$);
|
||||
|
||||
@@ -195,6 +199,7 @@ describe("VaultPopupAutofillService", () => {
|
||||
|
||||
// Refresh the current tab so the mockedPageDetails$ are used
|
||||
service.refreshCurrentTab();
|
||||
(service as any)._currentPageDetails$ = of(mockPageDetails);
|
||||
});
|
||||
|
||||
describe("doAutofill()", () => {
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Injectable } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import {
|
||||
combineLatest,
|
||||
debounceTime,
|
||||
firstValueFrom,
|
||||
map,
|
||||
Observable,
|
||||
@@ -164,6 +165,7 @@ export class VaultPopupAutofillService {
|
||||
}),
|
||||
);
|
||||
}),
|
||||
debounceTime(50),
|
||||
shareReplay({ refCount: false, bufferSize: 1 }),
|
||||
);
|
||||
|
||||
|
||||
@@ -55,14 +55,19 @@ export class Collection extends Domain {
|
||||
encryptService: EncryptService,
|
||||
orgKey: OrgKey,
|
||||
): Promise<Collection> {
|
||||
return Object.assign(
|
||||
new Collection({
|
||||
name: await encryptService.encryptString(view.name, orgKey),
|
||||
id: view.id,
|
||||
organizationId: view.organizationId,
|
||||
}),
|
||||
view,
|
||||
);
|
||||
const collection = new Collection({
|
||||
name: await encryptService.encryptString(view.name, orgKey),
|
||||
id: view.id,
|
||||
organizationId: view.organizationId,
|
||||
});
|
||||
|
||||
collection.externalId = view.externalId;
|
||||
collection.readOnly = view.readOnly;
|
||||
collection.hidePasswords = view.hidePasswords;
|
||||
collection.manage = view.manage;
|
||||
collection.type = view.type;
|
||||
|
||||
return collection;
|
||||
}
|
||||
|
||||
decrypt(orgKey: OrgKey, encryptService: EncryptService): Promise<CollectionView> {
|
||||
|
||||
@@ -102,12 +102,15 @@ export class CollectionView implements View, ITreeNodeObject {
|
||||
encryptService: EncryptService,
|
||||
key: OrgKey,
|
||||
): Promise<CollectionView> {
|
||||
const view: CollectionView = Object.assign(
|
||||
new CollectionView({ ...collection, name: "" }),
|
||||
collection,
|
||||
);
|
||||
const view = new CollectionView({ ...collection, name: "" });
|
||||
|
||||
view.name = await encryptService.decryptString(collection.name, key);
|
||||
view.assigned = true;
|
||||
view.externalId = collection.externalId;
|
||||
view.readOnly = collection.readOnly;
|
||||
view.hidePasswords = collection.hidePasswords;
|
||||
view.manage = collection.manage;
|
||||
view.type = collection.type;
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user