ensure we call the callback

This commit is contained in:
Johannes Zellner
2018-03-28 14:32:21 +02:00
parent 551912145e
commit 63ae9a90cf

View File

@@ -134,14 +134,16 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
if (!$scope.appstoreConfig.token) return callback();
AppStore.getProfile($scope.appstoreConfig.token, function (error, result) {
if (error) return console.error(error);
if (error) return callback(error);
$scope.appstoreConfig.profile = result;
AppStore.getSubscription($scope.appstoreConfig, function (error, result) {
if (error) return console.error(error);
if (error) return callback(error);
$scope.subscription = result;
callback();
});
});
}
@@ -204,7 +206,9 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
$scope.appstoreConfig = result;
$scope.fetchAppstoreProfileAndSubscription(function () {
$scope.fetchAppstoreProfileAndSubscription(function (error) {
if (error) console.error(error);
$scope.ready = true;
});
});