FS-8205 [verto_communicator] fix config reload

This commit is contained in:
Stefan Yohansson 2015-09-24 14:48:41 -03:00 committed by Ken Rice
parent 77fd36fa24
commit b213ceaf51
3 changed files with 16 additions and 7 deletions

View File

@ -100,8 +100,23 @@
});
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);
});
};

View File

@ -31,10 +31,6 @@
$location.path('/');
}
$rootScope.$on('config.http.success', function(ev) {
$scope.login();
});
/**
* Login the user to verto server and
* redirects him to dialpad page.

View File

@ -61,10 +61,8 @@ 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;
});