Start the events stream once the app starts (if credentials are in cache) or once the user gets logged in

This commit is contained in:
Emmanuel ROHEE 2014-08-28 11:04:01 +02:00
parent 660129deb1
commit 6ac298f2f1
4 changed files with 4 additions and 9 deletions

View file

@ -79,13 +79,11 @@ matrixWebClient.config(['$routeProvider', '$provide', '$httpProvider',
$httpProvider.interceptors.push('AccessTokenInterceptor');
}]);
matrixWebClient.run(['$location', 'matrixService', 'eventStreamService', function($location, matrixService, eventStreamService) {
matrixWebClient.run(['$location', 'matrixService', function($location, matrixService) {
// If user auth details are not in cache, go to the login page
if (!matrixService.isUserLoggedIn()) {
eventStreamService.stop();
$location.path("login");
}
else {
// eventStreamService.resume();
}
}]);