mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-26 19:47:05 +03:00
BF: Pass desired_user_id to register API. And update the app header to avoid to display the previous matrix id
This commit is contained in:
parent
df752a15ce
commit
f81002df60
2 changed files with 10 additions and 2 deletions
|
@ -81,6 +81,10 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
|
||||||
$scope.logout();
|
$scope.logout();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.updateHeader = function() {
|
||||||
|
$scope.user_id = matrixService.config().user_id;
|
||||||
|
};
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ angular.module('RegisterController', ['matrixService'])
|
||||||
|
|
||||||
$scope.account = {
|
$scope.account = {
|
||||||
homeserver: hs_url,
|
homeserver: hs_url,
|
||||||
|
desired_user_id: "",
|
||||||
desired_user_name: "",
|
desired_user_name: "",
|
||||||
user_id: "",
|
|
||||||
password: "",
|
password: "",
|
||||||
identityServer: "http://matrix.org:8090",
|
identityServer: "http://matrix.org:8090",
|
||||||
pwd1: "",
|
pwd1: "",
|
||||||
|
@ -59,7 +59,7 @@ angular.module('RegisterController', ['matrixService'])
|
||||||
return;
|
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) {
|
function(response) {
|
||||||
$scope.feedback = "Success";
|
$scope.feedback = "Success";
|
||||||
// Update the current config
|
// Update the current config
|
||||||
|
@ -72,6 +72,10 @@ angular.module('RegisterController', ['matrixService'])
|
||||||
|
|
||||||
// And permanently save it
|
// And permanently save it
|
||||||
matrixService.saveConfig();
|
matrixService.saveConfig();
|
||||||
|
|
||||||
|
// Update the global scoped used_id var (used in the app header)
|
||||||
|
$scope.updateHeader();
|
||||||
|
|
||||||
eventStreamService.resume();
|
eventStreamService.resume();
|
||||||
|
|
||||||
if ($scope.account.displayName) {
|
if ($scope.account.displayName) {
|
||||||
|
|
Loading…
Reference in a new issue