1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

processingNotes takes remainder of row lines

This commit is contained in:
Kyle Spearrin
2019-04-15 23:02:14 -04:00
parent d3a2dfe2e8
commit 39c1384a98

View File

@@ -210,12 +210,14 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
let notes: string = null; let notes: string = null;
const dataObj: any = {}; const dataObj: any = {};
let processingNotes = false;
extraParts.forEach((extraPart) => { extraParts.forEach((extraPart) => {
let key: string = null;
let val: string = null;
if (!processingNotes) {
if (this.isNullOrWhitespace(extraPart)) { if (this.isNullOrWhitespace(extraPart)) {
return; return;
} }
let key: string = null;
let val: string = null;
const colonIndex = extraPart.indexOf(':'); const colonIndex = extraPart.indexOf(':');
if (colonIndex === -1) { if (colonIndex === -1) {
key = extraPart; key = extraPart;
@@ -228,13 +230,17 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
if (this.isNullOrWhitespace(key) || this.isNullOrWhitespace(val) || key === 'NoteType') { if (this.isNullOrWhitespace(key) || this.isNullOrWhitespace(val) || key === 'NoteType') {
return; return;
} }
}
if (key === 'Notes') { if (processingNotes) {
notes += ('\n' + extraPart);
} else if (key === 'Notes') {
if (!this.isNullOrWhitespace(notes)) { if (!this.isNullOrWhitespace(notes)) {
notes += ('\n' + val); notes += ('\n' + val);
} else { } else {
notes = val; notes = val;
} }
processingNotes = true;
} else if (map.hasOwnProperty(key)) { } else if (map.hasOwnProperty(key)) {
dataObj[map[key]] = val; dataObj[map[key]] = val;
} else { } else {