mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 17:53:39 +00:00
Changed logic to validate if cipher has a collection on targetSelector method (#8422)
Added tests to import.service.spec.ts that test if the collectionRelationship and folderRelationship properly adapts
This commit is contained in:
@@ -437,8 +437,10 @@ export class ImportService implements ImportServiceAbstraction {
|
||||
|
||||
const noCollectionRelationShips: [number, number][] = [];
|
||||
importResult.ciphers.forEach((c, index) => {
|
||||
if (!Array.isArray(c.collectionIds) || c.collectionIds.length == 0) {
|
||||
c.collectionIds = [importTarget.id];
|
||||
if (
|
||||
!Array.isArray(importResult.collectionRelationships) ||
|
||||
!importResult.collectionRelationships.some(([cipherPos]) => cipherPos === index)
|
||||
) {
|
||||
noCollectionRelationShips.push([index, 0]);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user