1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

default type is login

This commit is contained in:
Kyle Spearrin 2018-10-25 08:20:31 -04:00
parent 4165a78277
commit 06f129e2c1

View File

@ -85,8 +85,12 @@ export class BitwardenCsvImporter extends BaseImporter implements Importer {
const valueType = value.type != null ? value.type.toLowerCase() : null; const valueType = value.type != null ? value.type.toLowerCase() : null;
switch (valueType) { switch (valueType) {
case 'login': case 'note':
case null: cipher.type = CipherType.SecureNote;
cipher.secureNote = new SecureNoteView();
cipher.secureNote.type = SecureNoteType.Generic;
break;
default:
cipher.type = CipherType.Login; cipher.type = CipherType.Login;
cipher.login = new LoginView(); cipher.login = new LoginView();
cipher.login.totp = this.getValueOrDefault(value.login_totp || value.totp); cipher.login.totp = this.getValueOrDefault(value.login_totp || value.totp);
@ -95,13 +99,6 @@ export class BitwardenCsvImporter extends BaseImporter implements Importer {
const uris = this.parseSingleRowCsv(value.login_uri || value.uri); const uris = this.parseSingleRowCsv(value.login_uri || value.uri);
cipher.login.uris = this.makeUriArray(uris); cipher.login.uris = this.makeUriArray(uris);
break; break;
case 'note':
cipher.type = CipherType.SecureNote;
cipher.secureNote = new SecureNoteView();
cipher.secureNote.type = SecureNoteType.Generic;
break;
default:
break;
} }
result.ciphers.push(cipher); result.ciphers.push(cipher);