1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

service fixes for ciphers

This commit is contained in:
Kyle Spearrin
2017-10-14 14:27:14 -04:00
parent 5a1bf8299f
commit 355a58f67c
5 changed files with 179 additions and 162 deletions

View File

@@ -6,8 +6,9 @@
this.notes = cipher.notes ? cipher.notes.encryptedString : null;
this.favorite = cipher.favorite;
var constantsService = chrome.extension.getBackgroundPage().bg_constantsService;
switch (type) {
case 1: // cipherType.login
case constantsService.cipherType.login:
this.login = {
uri: cipher.login.uri ? cipher.login.uri.encryptedString : null,
username: cipher.login.username ? cipher.login.username.encryptedString : null,
@@ -15,12 +16,12 @@
totp: cipher.login.totp ? cipher.login.totp.encryptedString : null
};
break;
case 2: // cipherType.secureNote
case constantsService.cipherType.secureNote:
this.secureNote = {
type: cipher.secureNote.type
};
break;
case 3: // cipherType.card
case constantsService.cipherType.card:
this.card = {
cardholderName: cipher.card.cardholderName ? cipher.card.cardholderName.encryptedString : null,
brand: cipher.card.brand ? cipher.card.brand.encryptedString : null,
@@ -30,7 +31,7 @@
code: cipher.card.code ? cipher.card.code.encryptedString : null
};
break;
case 4: // cipherType.identity
case constantsService.cipherType.identity:
this.identity = {
title: cipher.identity.title ? cipher.identity.title.encryptedString : null,
firstName: cipher.identity.firstName ? cipher.identity.firstName.encryptedString : null,