1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

update listing when cipher is edited

This commit is contained in:
Kyle Spearrin
2017-10-12 15:48:30 -04:00
parent 001a116c8b
commit 598c7ea068
5 changed files with 23 additions and 16 deletions

View File

@@ -145,11 +145,18 @@
var rootCipher = findRootCipher(cipher) || { meta: {} };
if (returnVal.action === 'edit') {
cipher.folderId = rootCipher.folderId = returnVal.data.folderId;
cipher.name = rootCipher.name = returnVal.data.name;
cipher.subTitle = rootCipher.subTitle = returnVal.data.login.username;
cipher.meta.password = rootCipher.meta.password = returnVal.data.login.password;
cipher.favorite = rootCipher.favorite = returnVal.data.favorite;
var index = $scope.ciphers.indexOf(cipher);
if (index > -1) {
returnVal.data.collectionIds = $scope.ciphers[index].collectionIds;
$scope.ciphers[index] = returnVal.data;
if ($rootScope.vaultCiphers) {
index = $rootScope.vaultCiphers.indexOf(rootCipher);
if (index > -1) {
$rootScope.vaultCiphers[index] = returnVal.data;
}
}
}
}
else if (returnVal.action === 'partialEdit') {
cipher.folderId = rootCipher.folderId = returnVal.data.folderId;