From bd498b47b340431793cc897c751b7cbcd6148745 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 28 Dec 2015 02:36:18 +0000 Subject: [PATCH 1/7] fix 'this' scoping bug that could never have worked... --- src/components/views/create_room/RoomAlias.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/create_room/RoomAlias.js b/src/components/views/create_room/RoomAlias.js index 9a30d3fbff..cc7382aadb 100644 --- a/src/components/views/create_room/RoomAlias.js +++ b/src/components/views/create_room/RoomAlias.js @@ -56,8 +56,9 @@ module.exports = React.createClass({ if (this.props.homeserver) { if (curr_val == "") { + var self = this; setTimeout(function() { - target.value = "#:" + this.props.homeserver; + target.value = "#:" + self.props.homeserver; target.setSelectionRange(1, 1); }, 0); } else { From 50ac0ab4cf289b4887b06f052b51e7dc43b24b01 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 28 Dec 2015 02:36:28 +0000 Subject: [PATCH 2/7] wire up RoomAlias's homeserver as intended --- src/components/structures/CreateRoom.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/CreateRoom.js b/src/components/structures/CreateRoom.js index d6002fb84c..f520318a0a 100644 --- a/src/components/structures/CreateRoom.js +++ b/src/components/structures/CreateRoom.js @@ -251,13 +251,15 @@ module.exports = React.createClass({ var UserSelector = sdk.getComponent("elements.UserSelector"); var RoomHeader = sdk.getComponent("rooms.RoomHeader"); + var domain = MatrixClientPeg.get().credentials.userId.replace(/^.*:/, ''); + return (