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

filter favorite ciphers from controller

This commit is contained in:
Kyle Spearrin
2017-12-19 21:39:44 -05:00
parent c1189e3318
commit f77e3b09ea
2 changed files with 9 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ angular
.module('bit.vault')
.controller('vaultController', function ($scope, $rootScope, cipherService, folderService, $q, $state, $stateParams, toastr,
syncService, utilsService, $analytics, i18nService, stateService, $timeout, $window, collectionService) {
syncService, utilsService, $analytics, i18nService, stateService, $timeout, $window, collectionService, $filter) {
var stateKey = 'vault',
state = stateService.getState(stateKey) || {};
stateService.removeState('viewGrouping');
@@ -25,8 +25,13 @@ angular
$scope.loaded = true;
if (!$rootScope.vaultCiphers) {
$rootScope.vaultCiphers = [];
$scope.favoriteCiphers = [];
delayLoad = false;
}
else {
$scope.favoriteCiphers = $filter('filter')($rootScope.vaultCiphers, { favorite: true });
}
if (!$rootScope.vaultFolders) {
$rootScope.vaultFolders = [];
delayLoad = false;
@@ -68,6 +73,7 @@ angular
$rootScope.vaultFolders = decFolders;
$rootScope.vaultCollections = decCollections;
$rootScope.vaultCiphers = decCiphers;
$scope.favoriteCiphers = $filter('filter')($rootScope.vaultCiphers, { favorite: true });
if ($scope.showGroupingCounts) {
var folderCounts = { 'none': 0 };