Fix active vault bug in settings

This commit is contained in:
brantje 2016-09-25 17:19:05 +02:00
parent c132ab6c6c
commit 0714bddb3b

View file

@ -10,7 +10,7 @@
angular.module('passmanApp') angular.module('passmanApp')
.controller('SettingsCtrl', ['$scope', '$rootScope', 'SettingsService', 'VaultService', 'CredentialService', '$location', '$routeParams', '$http', .controller('SettingsCtrl', ['$scope', '$rootScope', 'SettingsService', 'VaultService', 'CredentialService', '$location', '$routeParams', '$http',
function ($scope, $rootScope, SettingsService, VaultService, CredentialService, $location, $routeParams, $http) { function ($scope, $rootScope, SettingsService, VaultService, CredentialService, $location, $routeParams, $http) {
$scope.active_vault = VaultService.getActiveVault();
$scope.tabs = [ $scope.tabs = [
{ {
title: 'General settings', title: 'General settings',
@ -53,7 +53,9 @@ angular.module('passmanApp')
$scope.$watch(function () { $scope.$watch(function () {
return VaultService.getActiveVault() return VaultService.getActiveVault()
}, function (vault) { }, function (vault) {
$scope.active_vault = vault; if(vault) {
$scope.active_vault = vault;
}
}); });
if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) {