Fix build package viewer to use the archive url from the status API call

This commit is contained in:
Joseph Schorr 2014-03-17 14:53:05 -04:00
parent 3542a520f5
commit 14182a94f2

View file

@ -856,16 +856,11 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
$scope.loaded = true;
};
var downloadBuildPack = function() {
var downloadBuildPack = function(url) {
$scope.downloadProgress = 0;
$scope.downloading = true;
ApiService.getRepoBuildArchiveUrl(null, params).then(function(resp) {
startDownload(resp['url']);
}, function() {
$scope.downloading = false;
$scope.downloadError = true;
});
startDownload(url);
};
var startDownload = function(url) {
@ -916,7 +911,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
'name': name
};
downloadBuildPack();
downloadBuildPack(resp['archive_url']);
return resp;
});
};