Fix trial badge flickering

This commit is contained in:
Johannes Zellner
2018-04-23 20:54:54 +02:00
parent 8519d6665e
commit 7107672358
+6 -6
View File
@@ -97,16 +97,16 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
}
$scope.fetchAppstoreProfileAndSubscription = function (callback) {
Client.getAppstoreConfig(function (error, result) {
Client.getAppstoreConfig(function (error, appstoreConfig) {
if (error) return callback(error);
if (!result.token) return callback();
if (!appstoreConfig.token) return callback();
$scope.appstoreConfig = result;
AppStore.getProfile($scope.appstoreConfig.token, function (error, result) {
AppStore.getProfile(appstoreConfig.token, function (error, result) {
if (error) return callback(error);
$scope.appstoreConfig.profile = result;
// assign late to avoid UI flicketing on update
appstoreConfig.profile = result;
$scope.appstoreConfig = $scope.appstoreConfig;
AppStore.getSubscription($scope.appstoreConfig, function (error, result) {
if (error) return callback(error);