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) {
|
||||
if (!Features.BILLING) { return; }
|
||||
|
||||
if (plans) {
|
||||
if (plans && plans.length) {
|
||||
callback(plans);
|
||||
return;
|
||||
}
|
||||
|
||||
ApiService.listPlans().then(function(data) {
|
||||
var i = 0;
|
||||
for(i = 0; i < data.plans.length; i++) {
|
||||
planDict[data.plans[i].stripeId] = data.plans[i];
|
||||
}
|
||||
plans = data.plans;
|
||||
if (plans) {
|
||||
callback(plans);
|
||||
plans = data.plans || [];
|
||||
for(var i = 0; i < plans.length; i++) {
|
||||
planDict[plans[i].stripeId] = plans[i];
|
||||
}
|
||||
callback(plans);
|
||||
}, function() { callback([]); });
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue