Handle the case where the plans do not load correctly.
This commit is contained in:
parent
738c4a86ff
commit
bbb48b1235
1 changed files with 5 additions and 8 deletions
|
@ -1093,20 +1093,17 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
||||||
planService.verifyLoaded = function(callback) {
|
planService.verifyLoaded = function(callback) {
|
||||||
if (!Features.BILLING) { return; }
|
if (!Features.BILLING) { return; }
|
||||||
|
|
||||||
if (plans) {
|
if (plans && plans.length) {
|
||||||
callback(plans);
|
callback(plans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiService.listPlans().then(function(data) {
|
ApiService.listPlans().then(function(data) {
|
||||||
var i = 0;
|
plans = data.plans || [];
|
||||||
for(i = 0; i < data.plans.length; i++) {
|
for(var i = 0; i < plans.length; i++) {
|
||||||
planDict[data.plans[i].stripeId] = data.plans[i];
|
planDict[plans[i].stripeId] = plans[i];
|
||||||
}
|
|
||||||
plans = data.plans;
|
|
||||||
if (plans) {
|
|
||||||
callback(plans);
|
|
||||||
}
|
}
|
||||||
|
callback(plans);
|
||||||
}, function() { callback([]); });
|
}, function() { callback([]); });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Reference in a new issue