1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

dont resolve a promise that hasnt been set up

This commit is contained in:
John Mitchell 2015-11-03 22:39:39 -05:00
parent e05988ff5d
commit ecb445e688

View File

@ -39,19 +39,25 @@ angular.module('LoadConfigHelper', ['Utilities'])
if(angular.isObject(response.data)){ if(angular.isObject(response.data)){
$AnsibleConfig = _.extend($AnsibleConfig, response.data); $AnsibleConfig = _.extend($AnsibleConfig, response.data);
Store('AnsibleConfig', $AnsibleConfig); Store('AnsibleConfig', $AnsibleConfig);
$rootScope.loginConfig.resolve('config loaded'); if ($rootScope.loginConfig) {
$rootScope.loginConfig.resolve('config loaded');
}
$rootScope.$emit('ConfigReady'); $rootScope.$emit('ConfigReady');
} }
else { else {
$log.info('local_settings.json is not a valid object'); $log.info('local_settings.json is not a valid object');
$rootScope.loginConfig.resolve('config loaded'); if ($rootScope.loginConfig) {
$rootScope.loginConfig.resolve('config loaded');
}
$rootScope.$emit('ConfigReady'); $rootScope.$emit('ConfigReady');
} }
}, function() { }, function() {
//local_settings.json not found //local_settings.json not found
$log.info('local_settings.json not found'); $log.info('local_settings.json not found');
$rootScope.loginConfig.resolve('config loaded'); if ($rootScope.loginConfig) {
$rootScope.loginConfig.resolve('config loaded');
}
$rootScope.$emit('ConfigReady'); $rootScope.$emit('ConfigReady');
}); });
}); });