1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

vault listing page fixes

This commit is contained in:
Kyle Spearrin
2017-10-13 23:11:42 -04:00
parent b5c70c4941
commit 5a1bf8299f
9 changed files with 71 additions and 54 deletions

View File

@@ -278,17 +278,13 @@ function buildDomainModel(model, obj, map, alreadyEncrypted, notEncList) {
}
(function () {
var bg = chrome.extension.getBackgroundPage(),
cryptoService = bg ? bg.bg_cryptoService : null;
CipherString.prototype.decrypt = function (orgId) {
if (this.decryptedValue) {
var deferred = Q.defer();
deferred.resolve(this.decryptedValue);
return deferred.promise;
return Q(this.decryptedValue);
}
var self = this;
var self = this,
cryptoService = chrome.extension.getBackgroundPage().bg_cryptoService;
return cryptoService.getOrgKey(orgId).then(function (orgKey) {
return cryptoService.decrypt(self, orgKey);
}).then(function (decValue) {
@@ -416,15 +412,19 @@ function buildDomainModel(model, obj, map, alreadyEncrypted, notEncList) {
switch (self.type) {
case 1: // cipherType.login
model.login = decObj;
model.subTitle = model.login.username;
break;
case 2: // cipherType.secureNote
model.secureNote = decObj;
model.subTitle = '-';
break;
case 3: // cipherType.card
model.card = decObj;
model.subTitle = model.identity.brand;
break;
case 4: // cipherType.identity
model.identity = decObj;
model.subTitle = model.identity.firstName;
break;
default:
break;