1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-30 13:03:53 +01:00

fix grouping first

This commit is contained in:
Kyle Spearrin 2019-01-24 12:04:42 -05:00
parent 09df62db4c
commit 62b074ae22

View File

@ -25,12 +25,16 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
results.forEach((value, index) => { results.forEach((value, index) => {
const cipherIndex = result.ciphers.length; const cipherIndex = result.ciphers.length;
let folderIndex = result.folders.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; let addFolder = hasFolder;
if (hasFolder) { if (hasFolder) {
for (let i = 0; i < result.folders.length; i++) { for (let i = 0; i < result.folders.length; i++) {
if (result.folders[i].name === value.grouping) { if (result.folders[i].name === grouping) {
addFolder = false; addFolder = false;
folderIndex = i; folderIndex = i;
break; break;
@ -67,10 +71,7 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
if (addFolder) { if (addFolder) {
const f = new FolderView(); const f = new FolderView();
f.name = value.grouping; f.name = grouping;
if (f.name != null) {
f.name = f.name.replace(/\\/g, '/');
}
result.folders.push(f); result.folders.push(f);
} }
if (hasFolder) { if (hasFolder) {