Added default vault opening after logout to prevent confusion

Signed-off-by: fnuesse <felix.nuesse@t-online.de>
This commit is contained in:
fnuesse 2018-11-21 00:37:55 +01:00
parent e692cdba96
commit 34917099bf
No known key found for this signature in database
GPG key ID: 2089A3431243E819
3 changed files with 11 additions and 2 deletions

View file

@ -44,6 +44,8 @@
}
$scope.logout = function () {
//see vault.js:54
$rootScope.override_default_vault=true;
$scope.active_vault = false;
};
if (SettingsService.getSetting('defaultVault') && SettingsService.getSetting('defaultVaultPass')) {

View file

@ -34,6 +34,8 @@
.controller('MenuCtrl', ['$scope', 'VaultService', '$location', '$rootScope', 'TagService','SettingsService', '$translate',
function ($scope, VaultService, $location, $rootScope, TagService, SettingsService, $translate) {
$rootScope.logout = function () {
//see vault.js:54
$rootScope.override_default_vault=true;
SettingsService.setSetting('defaultVaultPass', false);
TagService.resetTags();
$rootScope.$broadcast('logout');

View file

@ -46,7 +46,11 @@
var vault = vaults[i];
if (vault.guid === default_vault.guid) {
$scope.default_vault = true;
$scope.list_selected_vault = vault;
//This prevents the opening of the default vault if the user logs out
if(!$rootScope.override_default_vault){
$scope.list_selected_vault = vault;
$rootScope.override_default_vault=false;
}
SettingsService.setSetting('defaultVault', vault);
if (SettingsService.getSetting('defaultVaultPass')) {
$location.path('/vault/' + vault.guid);
@ -219,7 +223,8 @@
};
$scope.createVault = function (vault_name, vault_key, vault_key2) {
$scope.createVault = function (vault_name, vault_key, vault_key2) {
if (vault_key !== vault_key2) {
$scope.error = $translate.instant('password.do.not.match');
return;