diff --git a/html5/verto/verto_communicator/src/storageService/services/splash_screen.js b/html5/verto/verto_communicator/src/storageService/services/splash_screen.js
index 3537313bbe..4cb97e7fd1 100644
--- a/html5/verto/verto_communicator/src/storageService/services/splash_screen.js
+++ b/html5/verto/verto_communicator/src/storageService/services/splash_screen.js
@@ -101,22 +101,7 @@
result['promise'] = configPromise;
- var connectCallback = function(v, connected) {
- verto.data.connecting = false;
- if (connected) {
- storage.data.ui_connected = verto.data.connected;
- storage.data.ws_connected = verto.data.connected;
- storage.data.name = verto.data.name;
- storage.data.email = verto.data.email;
- storage.data.login = verto.data.login;
- storage.data.password = verto.data.password;
- resolve(result);
- }
- };
-
- verto.data.connecting = true;
- verto.connect(connectCallback);
-
+ resolve(result);
});
};
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
index 4dd6879731..fc403843ec 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
@@ -30,12 +30,18 @@
console.debug('MainController: WebSocket not connected. Redirecting to login.');
$location.path('/');
}
-
+
+ $rootScope.$on('config.http.success', function(ev) {
+ $scope.login(false);
+ });
/**
* Login the user to verto server and
* redirects him to dialpad page.
*/
- $scope.login = function() {
+ $scope.login = function(redirect) {
+ if(redirect == undefined) {
+ redirect = true;
+ }
var connectCallback = function(v, connected) {
$scope.$apply(function() {
verto.data.connecting = false;
@@ -46,7 +52,9 @@
storage.data.email = verto.data.email;
storage.data.login = verto.data.login;
storage.data.password = verto.data.password;
- $location.path('/dialpad');
+ if (redirect) {
+ $location.path('/dialpad');
+ }
}
});
};
diff --git a/html5/verto/verto_communicator/src/vertoService/services/configService.js b/html5/verto/verto_communicator/src/vertoService/services/configService.js
index 2c302b6ad1..4ac73e0ee9 100644
--- a/html5/verto/verto_communicator/src/vertoService/services/configService.js
+++ b/html5/verto/verto_communicator/src/vertoService/services/configService.js
@@ -61,8 +61,10 @@ vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', '
verto.data.autologin_done = true;
}
+ $rootScope.$emit('config.http.success', data);
return response;
}, function(response) {
+ $rootScope.$emit('config.http.error', response);
return response;
});