From a633fa47aaf717a83cec5459b5e60a7c9d1098dd Mon Sep 17 00:00:00 2001 From: jakedt Date: Wed, 5 Mar 2014 16:50:32 -0500 Subject: [PATCH] Only reload the view when canceling the timer if a build recently finished. --- static/js/controllers.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/controllers.js b/static/js/controllers.js index 5c3e25f6a..79f1fc515 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -696,6 +696,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi } } + var existingBuilds = $scope.runningBuilds || []; $scope.runningBuilds = runningBuilds; $scope.buildHistory = resp.builds; @@ -706,8 +707,10 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi // Mark the repo as no longer building. $scope.repo.is_building = false; - // Reload the repo information. - loadViewInfo(); + // Reload the repo information if all of the builds recently finished. + if (existingBuilds.length > 0) { + loadViewInfo(); + } } }); };