diff --git a/src/views/app.js b/src/views/app.js index b65834d01..537d2bec6 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -770,7 +770,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.ready = true; - $interval(function () { refreshApp(); }, 5000); // call with inline function to avoid iteration argument passed see $interval docs + var refreshTimer = $interval(function () { refreshApp(); }, 5000); // call with inline function to avoid iteration argument passed see $interval docs + $scope.$on('$destroy', function () { + $interval.cancel(refreshTimer); + }); }); }); }); diff --git a/src/views/apps.js b/src/views/apps.js index 2174ef120..9c3be6aaa 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -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;