diff --git a/apps/browser/src/vault/popup/services/vault-popup-autofill.service.spec.ts b/apps/browser/src/vault/popup/services/vault-popup-autofill.service.spec.ts index 616c75c3fa8..f271b255c3e 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-autofill.service.spec.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-autofill.service.spec.ts @@ -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()", () => { diff --git a/apps/browser/src/vault/popup/services/vault-popup-autofill.service.ts b/apps/browser/src/vault/popup/services/vault-popup-autofill.service.ts index 4e995e093e6..2d30e857573 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-autofill.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-autofill.service.ts @@ -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 }), ); diff --git a/libs/admin-console/src/common/collections/models/collection.ts b/libs/admin-console/src/common/collections/models/collection.ts index 196b15ef5e9..7de4462b0c8 100644 --- a/libs/admin-console/src/common/collections/models/collection.ts +++ b/libs/admin-console/src/common/collections/models/collection.ts @@ -55,14 +55,19 @@ export class Collection extends Domain { encryptService: EncryptService, orgKey: OrgKey, ): Promise { - 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 { diff --git a/libs/admin-console/src/common/collections/models/collection.view.ts b/libs/admin-console/src/common/collections/models/collection.view.ts index d8039820845..c4470fe13fb 100644 --- a/libs/admin-console/src/common/collections/models/collection.view.ts +++ b/libs/admin-console/src/common/collections/models/collection.view.ts @@ -102,12 +102,15 @@ export class CollectionView implements View, ITreeNodeObject { encryptService: EncryptService, key: OrgKey, ): Promise { - 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; }