Skip to content

Commit

Permalink
UI: Fetch external IP address only once on init
Browse files Browse the repository at this point in the history
  • Loading branch information
YarovoiVadym authored and eran-nussbaum committed Jun 28, 2018
1 parent d139a14 commit 111fb8f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/dashboard/ui/src/app/app.run.js
Expand Up @@ -4,7 +4,7 @@
angular.module('nuclio.app')
.run(appInit);

function appInit($rootScope, $state, $urlRouter, $http, $httpBackend, $injector, lodash, ConfigService) {
function appInit($rootScope, $state, $urlRouter, $http, $httpBackend, $injector, lodash, ConfigService, DialogsService, NuclioProjectsDataService) {
// @if !IGZ_TESTING
$rootScope.$on('$locationChangeSuccess', function (event) {
// @if IGZ_E2E_TESTING
Expand All @@ -24,6 +24,15 @@
.then(function (config) {
lodash.merge(ConfigService, config.data);
$urlRouter.sync();
})
.then(function () {
NuclioProjectsDataService.getExternalIPAddresses()
.then(function (response) {
ConfigService.externalIPAddress = response.data.externalIPAddresses.addresses[0];
})
.catch(function () {
DialogsService.alert('Oops: Unknown error occurred while retrieving external IP address');
});
});
}
});
Expand Down

0 comments on commit 111fb8f

Please sign in to comment.