From cee2628b4139205ea983e9f4921b06570ff36c61 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 29 Mar 2017 15:24:47 +0100 Subject: [PATCH] Use Login & Register via component interface Login & Register were being imprted directly for some reason, rather than going via the normal component interface. Should be functionally identical. --- src/components/structures/MatrixChat.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 8ae38b9f3c..d336fcf50d 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -29,10 +29,6 @@ var UserActivity = require("../../UserActivity"); var Presence = require("../../Presence"); var dis = require("../../dispatcher"); -var Login = require("./login/Login"); -var Registration = require("./login/Registration"); -var PostRegistration = require("./login/PostRegistration"); - var Modal = require("../../Modal"); var Tinter = require("../../Tinter"); var sdk = require('../../index'); @@ -1159,15 +1155,12 @@ module.exports = React.createClass({ }, render: function() { - var ForgotPassword = sdk.getComponent('structures.login.ForgotPassword'); - var LoggedInView = sdk.getComponent('structures.LoggedInView'); - // `loading` might be set to false before `loggedIn = true`, causing the default // (``) to be visible for a few MS (say, whilst a request is in-flight to // the RTS). So in the meantime, use `loggingIn`, which is true between // actions `on_logging_in` and `on_logged_in`. if (this.state.loading || this.state.loggingIn) { - var Spinner = sdk.getComponent('elements.Spinner'); + const Spinner = sdk.getComponent('elements.Spinner'); return (
@@ -1176,6 +1169,7 @@ module.exports = React.createClass({ } // needs to be before normal PageTypes as you are logged in technically else if (this.state.screen == 'post_registration') { + const PostRegistration = sdk.getComponent('structures.login.PostRegistration'); return ( @@ -1185,6 +1179,7 @@ module.exports = React.createClass({ * we should go through and figure out what we actually need to pass down, as well * as using something like redux to avoid having a billion bits of state kicking around. */ + const LoggedInView = sdk.getComponent('structures.LoggedInView'); return ( @@ -1207,6 +1202,7 @@ module.exports = React.createClass({
); } else if (this.state.screen == 'register') { + const Registration = sdk.getComponent('structures.login.Registration'); return ( ); } else if (this.state.screen == 'forgot_password') { + const ForgotPassword = sdk.getComponent('structures.login.ForgotPassword'); return ( ); } else { + const Login = sdk.getComponent('structures.login.Login'); var r = (