From 4a34bee2dc580cd244c6697729fcb88611bc5a7b Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 2 Feb 2017 11:12:43 +0000 Subject: [PATCH] Use localStorage `mx_team_token` to decide welcome page --- src/components/structures/BottomLeftMenu.js | 2 +- src/components/structures/HomePage.js | 29 ++----------------- src/skins/vector/css/_components.scss | 1 + .../{HomePage.css => _HomePage.scss} | 7 ++++- 4 files changed, 10 insertions(+), 29 deletions(-) rename src/skins/vector/css/vector-web/structures/{HomePage.css => _HomePage.scss} (91%) diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index 793f8405..162980f2 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -115,7 +115,7 @@ module.exports = React.createClass({ var TintableSvg = sdk.getComponent('elements.TintableSvg'); var homeButton; - if (SdkConfig.get().home_page) { + if (window.localStorage.getItem('mx_team_token')) { homeButton = (
diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index ecf2f271..67bf91bc 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -16,8 +16,6 @@ limitations under the License. 'use strict'; -import 'isomorphic-fetch'; - var React = require("react"); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var sdk = require('matrix-react-sdk'); @@ -26,40 +24,17 @@ module.exports = React.createClass({ displayName: 'HomePage', propTypes: { - config: React.PropTypes.object.isRequired, + teamToken: React.PropTypes.string.isRequired, collapsedRhs: React.PropTypes.bool, }, - getInitialState: function() { - return { - page: "" - }; - }, - - componentWillMount: function() { - fetch(this.props.config.home_page).then( - (response)=>{ - return response.text(); - }, - (error)=>{ - console.log(error); - this.setState({ page: "Couldn't load home page" }); - } - ).done( - (body)=>{ - this.setState({ page: body }); - } - ); - }, - render: function() { // const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader'); // return (
-
-
+