From 62b074ae2269c72c08df64d7d2fa83ecbd00b723 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 24 Jan 2019 12:04:42 -0500 Subject: [PATCH] fix grouping first --- src/importers/lastpassCsvImporter.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/importers/lastpassCsvImporter.ts b/src/importers/lastpassCsvImporter.ts index cbfebfec41..a78b23c6c5 100644 --- a/src/importers/lastpassCsvImporter.ts +++ b/src/importers/lastpassCsvImporter.ts @@ -25,12 +25,16 @@ export class LastPassCsvImporter extends BaseImporter implements Importer { results.forEach((value, index) => { const cipherIndex = result.ciphers.length; let folderIndex = result.folders.length; - const hasFolder = this.getValueOrDefault(value.grouping, '(none)') !== '(none)'; + let grouping = value.grouping; + if (grouping != null) { + grouping = grouping.replace(/\\/g, '/'); + } + const hasFolder = this.getValueOrDefault(grouping, '(none)') !== '(none)'; let addFolder = hasFolder; if (hasFolder) { for (let i = 0; i < result.folders.length; i++) { - if (result.folders[i].name === value.grouping) { + if (result.folders[i].name === grouping) { addFolder = false; folderIndex = i; break; @@ -67,10 +71,7 @@ export class LastPassCsvImporter extends BaseImporter implements Importer { if (addFolder) { const f = new FolderView(); - f.name = value.grouping; - if (f.name != null) { - f.name = f.name.replace(/\\/g, '/'); - } + f.name = grouping; result.folders.push(f); } if (hasFolder) {