mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
remove Object.assign (#16032)
This commit is contained in:
@@ -55,14 +55,19 @@ export class Collection extends Domain {
|
|||||||
encryptService: EncryptService,
|
encryptService: EncryptService,
|
||||||
orgKey: OrgKey,
|
orgKey: OrgKey,
|
||||||
): Promise<Collection> {
|
): Promise<Collection> {
|
||||||
return Object.assign(
|
const collection = new Collection({
|
||||||
new Collection({
|
name: await encryptService.encryptString(view.name, orgKey),
|
||||||
name: await encryptService.encryptString(view.name, orgKey),
|
id: view.id,
|
||||||
id: view.id,
|
organizationId: view.organizationId,
|
||||||
organizationId: view.organizationId,
|
});
|
||||||
}),
|
|
||||||
view,
|
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> {
|
decrypt(orgKey: OrgKey, encryptService: EncryptService): Promise<CollectionView> {
|
||||||
|
|||||||
@@ -102,12 +102,15 @@ export class CollectionView implements View, ITreeNodeObject {
|
|||||||
encryptService: EncryptService,
|
encryptService: EncryptService,
|
||||||
key: OrgKey,
|
key: OrgKey,
|
||||||
): Promise<CollectionView> {
|
): Promise<CollectionView> {
|
||||||
const view: CollectionView = Object.assign(
|
const view = new CollectionView({ ...collection, name: "" });
|
||||||
new CollectionView({ ...collection, name: "" }),
|
|
||||||
collection,
|
|
||||||
);
|
|
||||||
view.name = await encryptService.decryptString(collection.name, key);
|
view.name = await encryptService.decryptString(collection.name, key);
|
||||||
view.assigned = true;
|
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;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user