Make sure we cleanup polling timers on view switch

This commit is contained in:
Johannes Zellner
2019-09-18 18:18:43 +02:00
parent 1621f866a8
commit 23e15581f3
2 changed files with 7 additions and 1 deletions

View File

@@ -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;