1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

force vault refresh upon importing

This commit is contained in:
Kyle Spearrin 2017-04-21 14:24:24 -04:00
parent e010995b19
commit d61b6c2faa
3 changed files with 10 additions and 3 deletions

View File

@ -77,7 +77,10 @@ angular
url: '^/vault',
templateUrl: 'app/vault/views/vault.html',
controller: 'vaultController',
data: { pageTitle: 'My Vault' }
data: { pageTitle: 'My Vault' },
params: {
refreshFromServer: false
}
})
.state('backend.user.subvaults', {
url: '^/subvaults',

View File

@ -239,7 +239,7 @@
folderRelationships: folderRelationships
}, function () {
$uibModalInstance.dismiss('cancel');
$state.go('backend.user.vault').then(function () {
$state.go('backend.user.vault', { refreshFromServer: true }).then(function () {
$analytics.eventTrack('Imported Data', { label: $scope.model.source });
toastr.success('Data has been successfully imported into your vault.', 'Import Success');
});

View File

@ -2,11 +2,15 @@
.module('bit.vault')
.controller('vaultController', function ($scope, $uibModal, apiService, $filter, cryptoService, authService, toastr,
cipherService, $q, $localStorage, $timeout, $rootScope) {
cipherService, $q, $localStorage, $timeout, $rootScope, $state) {
$scope.loading = true;
$scope.logins = [];
$scope.favoriteCollapsed = $localStorage.collapsedFolders && 'favorite' in $localStorage.collapsedFolders;
if ($state.params.refreshFromServer) {
$rootScope.vaultFolders = $rootScope.vaultLogins = null;
}
$scope.$on('$viewContentLoaded', function () {
if ($rootScope.vaultFolders && $rootScope.vaultLogins) {
$scope.loading = false;