From 2e9e03bd455744c8afedcbadf7cc791f62d6a8cf Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 11 Nov 2015 00:39:48 +0100 Subject: [PATCH] oops, refresh the login options on mount. make autofocus work too. --- src/skins/vector/views/templates/Login.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/skins/vector/views/templates/Login.js b/src/skins/vector/views/templates/Login.js index e01bd1f7e..8bd9334e2 100644 --- a/src/skins/vector/views/templates/Login.js +++ b/src/skins/vector/views/templates/Login.js @@ -17,6 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); +var ReactDOM = require('react-dom'); var sdk = require('matrix-react-sdk') var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); @@ -44,6 +45,17 @@ module.exports = React.createClass({ customIsUrl: is_url || config.default_is_url, serverConfigVisible: (hs_url && hs_url !== config.default_hs_url || is_url && is_url !== config.default_is_url) + }; + }, + + componentDidMount: function() { + this.onHSChosen(); + }, + + componentDidUpdate: function() { + if (!this.state.focusFired && this.refs.user) { + this.refs.user.focus(); + this.setState({ focusFired: true }); } }, @@ -146,7 +158,7 @@ module.exports = React.createClass({ return (
-
+

{ this.componentForStep('choose_hs') }