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