summary refs log tree commit diff
path: root/webclient/login
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-15 13:43:07 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-15 14:06:56 +0100
commit7ddb7a5cbbe9e4576742dc060ba35ca863b8d8b0 (patch)
tree395bea9a7d9f95fab285ed9a68d8354dec016ff4 /webclient/login
parentStore messages in $rootScope so they can be accessed from multiple controller... (diff)
downloadsynapse-7ddb7a5cbbe9e4576742dc060ba35ca863b8d8b0.tar.xz
Event streaming now happens on an app level, rather than a per-room level. Make eventStreamService manage it's own repolling provided no one calls stop() on it. Couple the stream with eventHandlerService so any controller can just blithely call eventStreamService.resume() and expect to 'get stuff' without having to handle promises (though resume() still returns a promise for that request and proxies it through $q). Kill and reset the stream if you logout.
Diffstat (limited to 'webclient/login')
-rw-r--r--webclient/login/login-controller.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/webclient/login/login-controller.js b/webclient/login/login-controller.js
index 8bd6a4e84f..aa928ef48d 100644
--- a/webclient/login/login-controller.js
+++ b/webclient/login/login-controller.js
@@ -1,6 +1,6 @@
 angular.module('LoginController', ['matrixService'])
-.controller('LoginController', ['$scope', '$location', 'matrixService',
-                                    function($scope, $location, matrixService) {
+.controller('LoginController', ['$scope', '$location', 'matrixService', 'eventStreamService',
+                                    function($scope, $location, matrixService, eventStreamService) {
     'use strict';
     
     
@@ -51,7 +51,7 @@ angular.module('LoginController', ['matrixService'])
 
                 // And permanently save it
                 matrixService.saveConfig();
-
+                eventStreamService.resume();
                  // Go to the user's rooms list page
                 $location.path("rooms");
             },
@@ -83,6 +83,7 @@ angular.module('LoginController', ['matrixService'])
                         access_token: response.data.access_token
                     });
                     matrixService.saveConfig();
+                    eventStreamService.resume();
                     $location.path("rooms");
                 }
                 else {