Make sure we cleanup polling timers on view switch
This commit is contained in:
@@ -48,6 +48,9 @@ angular.module('Application').controller('AppsController', ['$scope', '$timeout'
|
||||
Client.refreshInstalledApps(); // refresh the new list immediately when switching from another view (appstore)
|
||||
|
||||
var refreshAppsTimer = $interval(Client.refreshInstalledApps.bind(Client), 5000);
|
||||
$scope.$on('$destroy', function () {
|
||||
$interval.cancel(refreshAppsTimer);
|
||||
});
|
||||
|
||||
if (!$scope.user.admin) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user