summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--webclient/app-controller.js4
-rw-r--r--webclient/login/register-controller.js8
2 files changed, 10 insertions, 2 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js
index 77a7ad03a5..172770f82f 100644
--- a/webclient/app-controller.js
+++ b/webclient/app-controller.js
@@ -81,6 +81,10 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
         $scope.logout();
     });
     
+    $scope.updateHeader = function() {
+        $scope.user_id = matrixService.config().user_id;
+    };
+    
 }]);
 
    
diff --git a/webclient/login/register-controller.js b/webclient/login/register-controller.js
index 9659b04ef2..0ece57502b 100644
--- a/webclient/login/register-controller.js
+++ b/webclient/login/register-controller.js
@@ -33,8 +33,8 @@ angular.module('RegisterController', ['matrixService'])
     
     $scope.account = {
         homeserver: hs_url,
+        desired_user_id: "",
         desired_user_name: "",
-        user_id: "",
         password: "",
         identityServer: "http://matrix.org:8090",
         pwd1: "",
@@ -59,7 +59,7 @@ angular.module('RegisterController', ['matrixService'])
             return;
         }
 
-        matrixService.register($scope.account.desired_user_name, $scope.account.pwd1).then(
+        matrixService.register($scope.account.desired_user_id, $scope.account.pwd1).then(
             function(response) {
                 $scope.feedback = "Success";
                 // Update the current config 
@@ -72,6 +72,10 @@ angular.module('RegisterController', ['matrixService'])
 
                 // And permanently save it
                 matrixService.saveConfig();
+                
+                // Update the global scoped used_id var (used in the app header)
+                $scope.updateHeader();
+                
                 eventStreamService.resume();
                 
                 if ($scope.account.displayName) {