From f14e38d9c5bcc378412e784008b71fe12411ea41 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 4 Jun 2016 17:10:54 +0800 Subject: [PATCH] fix bug --- app/scripts/controllers/main.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/scripts/controllers/main.js b/app/scripts/controllers/main.js index 5dc8cb9..99fa254 100644 --- a/app/scripts/controllers/main.js +++ b/app/scripts/controllers/main.js @@ -81,7 +81,11 @@ ariaNgCommonService.confirm('Confirm Remove', 'Are you sure you want to remove the selected task?', 'warning', function () { $rootScope.loadPromise = aria2TaskService.removeTasks(tasks, function (result) { - $location.path('/stopped'); + if ($location.path() == '/stopped') { + $route.reload(); + } else { + $location.path('/stopped'); + } }); }); }; @@ -89,7 +93,11 @@ $scope.clearStoppedTasks = function () { ariaNgCommonService.confirm('Confirm Clear', 'Are you sure you want to clear stopped tasks?', 'warning', function () { $rootScope.loadPromise = aria2TaskService.clearStoppedTasks(function (result) { - $location.path('/stopped'); + if ($location.path() == '/stopped') { + $route.reload(); + } else { + $location.path('/stopped'); + } }); }); };