1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Calling processFolder method when adding ciphers on PsonoJsonImporter (#7984)

This commit is contained in:
aj-rosado
2024-02-22 17:51:44 +00:00
committed by GitHub
parent fda656afaa
commit f9539ef68b
3 changed files with 26 additions and 8 deletions

View File

@@ -61,20 +61,22 @@ export class PsonoJsonImporter extends BaseImporter implements Importer {
this.parseFolders(result, folder.folders, folder.name);
}
this.processFolder(result, folder.name, folderHasItems);
this.handleItemParsing(result, folder.items);
if (!folderHasItems) {
this.processFolder(result, folder.name, folderHasItems);
} else {
this.handleItemParsing(result, folder.items, folder.name);
}
});
}
private handleItemParsing(result: ImportResult, items?: PsonoItemTypes[]) {
private handleItemParsing(result: ImportResult, items?: PsonoItemTypes[], folderName?: string) {
if (items == null || items.length === 0) {
return;
}
items.forEach((record) => {
const cipher = this.parsePsonoItem(record);
this.processFolder(result, folderName, true);
this.cleanupCipher(cipher);
result.ciphers.push(cipher);
});