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

@ -284,6 +284,11 @@
if (ariaNgSettingService.getDownloadTaskRefreshInterval() > 0) { if (ariaNgSettingService.getDownloadTaskRefreshInterval() > 0) {
downloadTaskRefreshPromise = $interval(function () { downloadTaskRefreshPromise = $interval(function () {
if ($scope.task && ($scope.task.status == 'complete' || $scope.task.status == 'error' || $scope.task.status == 'removed')) {
$interval.cancel(downloadTaskRefreshPromise);
return;
}
refreshDownloadTask(true); refreshDownloadTask(true);
}, ariaNgSettingService.getDownloadTaskRefreshInterval()); }, ariaNgSettingService.getDownloadTaskRefreshInterval());
} }