Fix trial badge flickering
This commit is contained in:
+6
-6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user