disable auto refreshing in task detail page when task is completed, error or removed

This commit is contained in:
MaysWind 2016-06-28 22:13:16 +08:00
parent 323a2635c0
commit 9d9a9a83c3

View file

@ -198,7 +198,7 @@
if (!$scope.task || !$scope.task.files || !ariaNgFileTypes[type]) {
return;
}
var extensions = ariaNgFileTypes[type];
var fileIndexes = [];
var isAllSelected = true;
@ -284,6 +284,11 @@
if (ariaNgSettingService.getDownloadTaskRefreshInterval() > 0) {
downloadTaskRefreshPromise = $interval(function () {
if ($scope.task && ($scope.task.status == 'complete' || $scope.task.status == 'error' || $scope.task.status == 'removed')) {
$interval.cancel(downloadTaskRefreshPromise);
return;
}
refreshDownloadTask(true);
}, ariaNgSettingService.getDownloadTaskRefreshInterval());
}