From 06f7515ca4e6999e7b04471a1eb2d7a6b5d84893 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 17 Feb 2016 17:47:22 +0100 Subject: [PATCH] Reload after login and logout (Fixes #1820) Not very nice solution but with DS.clear() we have to do a lot of more work with high effort. Can improved later. --- openslides/users/static/js/users/site.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index 1108e7604..611581865 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -129,10 +129,6 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) showClose: $stateParams.guest_enabled, closeByEscape: $stateParams.guest_enabled, closeByDocument: $stateParams.guest_enabled, - preCloseCallback: function() { - $state.go('home'); - return true; - } }); }] }); @@ -870,8 +866,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) $scope.logout = function () { $http.post('/users/logout/').then(function (response) { operator.setUser(null); - // TODO: remove all data from cache and reload page - // DS.flush(); + window.location.reload(); }); }; } @@ -912,6 +907,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) // Success: User logged in. operator.setUser(response.data.user_id); $scope.closeThisDialog(); + setTimeout(function(){ + window.location.replace('/'); + }, 1000); }, function (response) { // Error: Username or password is not correct.