Check on the builds array; it may not be present if the page has changed or the builds have not yet loaded
This commit is contained in:
parent
36435d38e3
commit
4282977e90
1 changed files with 4 additions and 0 deletions
|
@ -942,6 +942,8 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.handleBuildStarted = function(newBuild) {
|
$scope.handleBuildStarted = function(newBuild) {
|
||||||
|
if (!$scope.builds) { return; }
|
||||||
|
|
||||||
$scope.builds.unshift(newBuild);
|
$scope.builds.unshift(newBuild);
|
||||||
$scope.setCurrentBuild(newBuild['id'], true);
|
$scope.setCurrentBuild(newBuild['id'], true);
|
||||||
};
|
};
|
||||||
|
@ -980,6 +982,8 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
||||||
};
|
};
|
||||||
|
|
||||||
ApiService.requestRepoBuild(data, params).then(function(newBuild) {
|
ApiService.requestRepoBuild(data, params).then(function(newBuild) {
|
||||||
|
if (!$scope.builds) { return; }
|
||||||
|
|
||||||
$scope.builds.unshift(newBuild);
|
$scope.builds.unshift(newBuild);
|
||||||
$scope.setCurrentBuild(newBuild['id'], true);
|
$scope.setCurrentBuild(newBuild['id'], true);
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue