From b960d1d4627d3a10c078dcf8c40ba2475eab7fbe Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 17 Mar 2016 11:33:25 +0000 Subject: [PATCH] Make getCurrent[H|I]SUrl honour the state setting that comes from the url bar. Fixes @ara4n's later bug in https://github.com/vector-im/vector-web/issues/1027 --- src/components/structures/MatrixChat.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 838dd1bc02..e26cf57167 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -86,7 +86,9 @@ module.exports = React.createClass({ }, getCurrentHsUrl: function() { - if (MatrixClientPeg.get()) { + if (this.state.register_hs_url) { + return this.state.register_hs_url; + } else if (MatrixClientPeg.get()) { return MatrixClientPeg.get().getHomeserverUrl(); } else if (window.localStorage && window.localStorage.getItem("mx_hs_url")) { @@ -99,7 +101,9 @@ module.exports = React.createClass({ }, getCurrentIsUrl: function() { - if (MatrixClientPeg.get()) { + if (this.state.register_is_url) { + return this.state.register_is_url; + } else if (MatrixClientPeg.get()) { return MatrixClientPeg.get().getIdentityServerUrl(); } else if (window.localStorage && window.localStorage.getItem("mx_is_url")) {