1
0
mirror of https://github.com/bitwarden/web synced 2025-12-20 02:03:29 +00:00

remove sharing module. move subvaults

This commit is contained in:
Kyle Spearrin
2017-03-23 23:01:22 -04:00
parent d51eab779c
commit 1818dad0d1
12 changed files with 55 additions and 47 deletions

View File

@@ -0,0 +1,44 @@
angular
.module('bit.vault')
.controller('vaultSubvaultsController', function ($scope, apiService, cipherService, $analytics, $q) {
$scope.logins = [];
$scope.subvaults = [];
$scope.loading = true;
$scope.$on('$viewContentLoaded', function () {
var subvaultPromise = apiService.subvaults.listMe({}, function (subvaults) {
var decSubvaults = [];
for (var i = 0; i < subvaults.Data.length; i++) {
var decSubvault = cipherService.decryptSubvault(subvaults.Data[i], null, true);
decSubvaults.push(decSubvault);
}
$scope.subvaults = decSubvaults;
}).$promise;
var cipherPromise = apiService.ciphers.listSubvaults({}, function (ciphers) {
var decLogins = [];
for (var i = 0; i < ciphers.Data.length; i++) {
if (ciphers.Data[i].Type === 1) {
var decLogin = cipherService.decryptLoginPreview(ciphers.Data[i]);
decLogins.push(decLogin);
}
}
$scope.logins = decLogins;
}).$promise;
$q.all([subvaultPromise, cipherPromise]).then(function () {
$scope.loading = false;
});
});
$scope.filterBySubvault = function (subvault) {
return function (cipher) {
return cipher.subvaultIds.indexOf(subvault.id) > -1;
};
};
});