From f884d4a4eb49ea34674a265aae468cac14c6657f Mon Sep 17 00:00:00 2001 From: MaysWind Date: Tue, 7 Jun 2016 23:40:57 +0800 Subject: [PATCH] fix --- app/scripts/controllers/task-detail.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/scripts/controllers/task-detail.js b/app/scripts/controllers/task-detail.js index 3417035..3c9981d 100644 --- a/app/scripts/controllers/task-detail.js +++ b/app/scripts/controllers/task-detail.js @@ -4,6 +4,7 @@ angular.module('ariaNg').controller('TaskDetailController', ['$rootScope', '$scope', '$routeParams', '$interval', 'ariaNgCommonService', 'ariaNgSettingService', 'aria2TaskService', 'aria2SettingService', function ($rootScope, $scope, $routeParams, $interval, ariaNgCommonService, ariaNgSettingService, aria2TaskService, aria2SettingService) { var tabOrders = ['overview', 'blocks', 'filelist', 'btpeers']; var downloadTaskRefreshPromise = null; + var pauseDownloadTaskRefresh = false; var getAvailableOptions = function (status, isBittorrent) { var keys = aria2SettingService.getAvailableTaskOptionKeys(status, isBittorrent); @@ -30,6 +31,10 @@ }; var refreshDownloadTask = function (silent) { + if (pauseDownloadTaskRefresh) { + return; + } + return aria2TaskService.getTaskStatus($routeParams.gid, function (result) { if (result.status == 'active' && result.bittorrent) { refreshBtPeers(result, true); @@ -118,7 +123,10 @@ } } + pauseDownloadTaskRefresh = true; + return aria2TaskService.selectTaskFile(gid, selectedFileIndex, function () { + pauseDownloadTaskRefresh = false; refreshDownloadTask(false); }); };