Skip to content

Commit

Permalink
Merge pull request #2129 from privacyidea/2127/remove-Reload-Listener
Browse files Browse the repository at this point in the history
Remove checkReloadListener
  • Loading branch information
plettich committed Mar 23, 2020
2 parents 5805b52 + 1480b28 commit 26c5a00
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
Expand Up @@ -113,10 +113,6 @@ angular.module("privacyideaApp")
params: oldParams
};
});
$transitions.onSuccess({},
function() {
$scope.checkReloadListeners();
});

$scope.$on('IdleStart', function () {
//debug: console.log("start idle");
Expand Down Expand Up @@ -511,24 +507,6 @@ angular.module("privacyideaApp")
$scope.$broadcast("piReload");
};

$scope.checkReloadListeners = function () {
/*
TODO: The a logic, that can hide the reload button.
This is not straighforward, since the current number of connected
listeners might be confusing:
connected numbers:
var currentListeners = $scope.$$listenerCount["piReload"];
When the state changes, the scope and thus the current listener is
destroyed. But the statechange-success is called, before the scope
is destroyed, so there can be two connected listeners, when
changing from a state to another state and both have a listener
defined.
*/
$scope.reloadListeners = 1;
};

});

angular.module("privacyideaApp")
Expand Down
3 changes: 1 addition & 2 deletions privacyidea/static/templates/menu.html
Expand Up @@ -96,8 +96,7 @@
<li>
<spinner name="spinner" show="false"></spinner>
</li>
<li ng-show="reloadListeners && loggedInUser.role &&
showReload">
<li ng-show="loggedInUser.role && showReload">
<a ng-click="reload()" style="cursor: pointer">
<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
<translate>Refresh</translate>
Expand Down

0 comments on commit 26c5a00

Please sign in to comment.