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'); + } }); }); };