diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index 8f0c270513d..01aabf61151 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -91,15 +91,11 @@ class HomePage extends React.Component { this._unmounted = true; } - onLoginClick(ev) { - ev.preventDefault(); - ev.stopPropagation(); + onLoginClick() { dis.dispatch({ action: 'start_login' }); } - onRegisterClick(ev) { - ev.preventDefault(); - ev.stopPropagation(); + onRegisterClick() { dis.dispatch({ action: 'start_registration' }); } diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index a03265da1c8..b01174a91c9 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -927,10 +927,6 @@ export default React.createClass({ }, _viewHome: function() { - // The home page requires the "logged in" view, so we'll set that. - this.setStateForNewView({ - view: VIEWS.LOGGED_IN, - }); this._setPage(PageTypes.HomePage); this.notifyNewScreen('home'); }, @@ -1187,7 +1183,10 @@ export default React.createClass({ * @param {string} teamToken */ _onLoggedIn: async function(teamToken) { - this.setStateForNewView({view: VIEWS.LOGGED_IN}); + this.setState({ + view: VIEWS.LOGGED_IN, + }); + if (teamToken) { // A team member has logged in, not a guest this._teamToken = teamToken; diff --git a/src/components/structures/login/ForgotPassword.js b/src/components/structures/login/ForgotPassword.js index 5c0e4283397..559136948ac 100644 --- a/src/components/structures/login/ForgotPassword.js +++ b/src/components/structures/login/ForgotPassword.js @@ -162,18 +162,6 @@ module.exports = React.createClass({ this.setState(newState); }, - onLoginClick: function(ev) { - ev.preventDefault(); - ev.stopPropagation(); - this.props.onLoginClick(); - }, - - onRegisterClick: function(ev) { - ev.preventDefault(); - ev.stopPropagation(); - this.props.onRegisterClick(); - }, - showErrorDialog: function(body, title) { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createTrackedDialog('Forgot Password Error', '', ErrorDialog, { @@ -265,10 +253,10 @@ module.exports = React.createClass({ { serverConfigSection } { errorText } - + { _t('Return to login screen') } - + { _t('Create an account') } diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js index 321084389be..b94a1759cfe 100644 --- a/src/components/structures/login/Login.js +++ b/src/components/structures/login/Login.js @@ -214,10 +214,7 @@ module.exports = React.createClass({ }).done(); }, - _onLoginAsGuestClick: function(ev) { - ev.preventDefault(); - ev.stopPropagation(); - + _onLoginAsGuestClick: function() { const self = this; self.setState({ busy: true, @@ -300,12 +297,6 @@ module.exports = React.createClass({ }); }, - onRegisterClick: function(ev) { - ev.preventDefault(); - ev.stopPropagation(); - this.props.onRegisterClick(); - }, - _tryWellKnownDiscovery: async function(serverName) { if (!serverName.trim()) { // Nothing to discover @@ -576,7 +567,7 @@ module.exports = React.createClass({ { errorTextSection } { this.componentForStep(this.state.currentFlow) } { serverConfig } - + { _t('Create an account') } { loginAsGuestJsx } diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index fa5a02e8815..ad3ea5f19cd 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -363,12 +363,6 @@ module.exports = React.createClass({ } }, - onLoginClick: function(ev) { - ev.preventDefault(); - ev.stopPropagation(); - this.props.onLoginClick(); - }, - _makeRegisterRequest: function(auth) { // Only send the bind params if we're sending username / pw params // (Since we need to send no params at all to use the ones saved in the @@ -474,7 +468,7 @@ module.exports = React.createClass({ let signIn; if (!this.state.doingUIAuth) { signIn = ( - + { theme === 'status' ? _t('Sign in') : _t('I already have an account') } );