mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-17 10:45:41 +01:00
more fixes
This commit is contained in:
parent
176b9a8ed0
commit
fd146afb69
@ -1,5 +1,5 @@
|
||||
var CipherRequest = function (cipher, type) {
|
||||
this.type = type;
|
||||
var CipherRequest = function (cipher) {
|
||||
this.type = cipher.type;
|
||||
this.folderId = cipher.folderId;
|
||||
this.organizationId = cipher.organizationId;
|
||||
this.name = cipher.name ? cipher.name.encryptedString : null;
|
||||
@ -7,7 +7,7 @@
|
||||
this.favorite = cipher.favorite;
|
||||
|
||||
var constantsService = chrome.extension.getBackgroundPage().bg_constantsService;
|
||||
switch (type) {
|
||||
switch (this.type) {
|
||||
case constantsService.cipherType.login:
|
||||
this.login = {
|
||||
uri: cipher.login.uri ? cipher.login.uri.encryptedString : null,
|
||||
|
@ -420,15 +420,33 @@ function buildDomainModel(model, obj, map, alreadyEncrypted, notEncList) {
|
||||
break;
|
||||
case self.constantsService.cipherType.secureNote:
|
||||
model.secureNote = decObj;
|
||||
model.subTitle = '-';
|
||||
model.subTitle = null;
|
||||
break;
|
||||
case self.constantsService.cipherType.card:
|
||||
model.card = decObj;
|
||||
model.subTitle = model.identity.brand;
|
||||
model.subTitle = model.card.brand;
|
||||
if (model.card.brand) {
|
||||
model.subTitle = model.card.brand;
|
||||
}
|
||||
if (model.card.number && model.card.number.length >= 4) {
|
||||
if (model.subTitle !== '') {
|
||||
model.subTitle += ', ';
|
||||
}
|
||||
model.subTitle += ('*' + model.card.number.substr(model.card.number.length - 4));
|
||||
}
|
||||
break;
|
||||
case self.constantsService.cipherType.identity:
|
||||
model.identity = decObj;
|
||||
model.subTitle = model.identity.firstName;
|
||||
model.subTitle = '';
|
||||
if (model.identity.firstName) {
|
||||
model.subTitle = model.identity.firstName;
|
||||
}
|
||||
if (model.identity.lastName) {
|
||||
if (model.subTitle !== '') {
|
||||
model.subTitle += ' ';
|
||||
}
|
||||
model.subTitle += model.identity.lastName;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -314,8 +314,7 @@ function initLoginService() {
|
||||
var deferred = Q.defer();
|
||||
|
||||
var self = this,
|
||||
// TODO
|
||||
request = new CipherRequest(cipher, 1); // 1 = Login
|
||||
request = new CipherRequest(cipher);
|
||||
|
||||
if (!cipher.id) {
|
||||
self.apiService.postCipher(request).then(apiSuccess, function (response) {
|
||||
|
Loading…
Reference in New Issue
Block a user