fixes for password wallet

This commit is contained in:
Kyle Spearrin 2019-04-26 21:00:17 -04:00
parent 61723f74d2
commit 520f20d428
1 changed files with 16 additions and 7 deletions

View File

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