Skip to content

Commit

Permalink
disable auto refreshing in task detail page when task is completed, e…
Browse files Browse the repository at this point in the history
…rror or removed
  • Loading branch information
mayswind committed Jun 28, 2016
1 parent 323a263 commit 9d9a9a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scripts/controllers/task-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
if (!$scope.task || !$scope.task.files || !ariaNgFileTypes[type]) {
return;
}

var extensions = ariaNgFileTypes[type];
var fileIndexes = [];
var isAllSelected = true;
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 9d9a9a8

Please sign in to comment.