1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

fixes for password wallet

This commit is contained in:
Kyle Spearrin 2019-04-26 21:00:17 -04:00
parent 61723f74d2
commit 520f20d428

View File

@ -13,17 +13,26 @@ export class PasswordWalletTxtImporter extends BaseImporter implements Importer
} }
results.forEach((value) => { results.forEach((value) => {
if (value.length < 6) { if (value.length < 1) {
return; return;
} }
if (value.length > 5) {
this.processFolder(result, value[5]); this.processFolder(result, value[5]);
}
const cipher = this.initLoginCipher(); const cipher = this.initLoginCipher();
cipher.name = this.getValueOrDefault(value[0], '--'); cipher.name = this.getValueOrDefault(value[0], '--');
cipher.notes = this.getValueOrDefault(value[4]); if (value.length > 4) {
cipher.notes = this.getValueOrDefault(value[4], '').split('¬').join('\n');
}
if (value.length > 2) {
cipher.login.username = this.getValueOrDefault(value[2]); cipher.login.username = this.getValueOrDefault(value[2]);
}
if (value.length > 3) {
cipher.login.password = this.getValueOrDefault(value[3]); cipher.login.password = this.getValueOrDefault(value[3]);
}
if (value.length > 1) {
cipher.login.uris = this.makeUriArray(value[1]); cipher.login.uris = this.makeUriArray(value[1]);
}
this.cleanupCipher(cipher); this.cleanupCipher(cipher);
result.ciphers.push(cipher); result.ciphers.push(cipher);
}); });