From 1e1a43c78fc2640415b90eaa52a4160b53d10ed2 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 30 May 2017 21:52:43 +0100 Subject: [PATCH] support iframes for RTS urls --- src/components/structures/HomePage.js | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index 810a0a44..8b5b2f3c 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -43,16 +43,16 @@ module.exports = React.createClass({ }, componentWillMount: function() { + if (this.props.teamToken && this.props.teamServerUrl) { + return; + } + // we use request() to inline the homepage into the react component // so that it can inherit CSS and theming easily rather than mess around // with iframes and trying to synchronise document.stylesheets. let src = this.props.homePageUrl || '/home.html'; - if (this.props.teamToken && this.props.teamServerUrl) { - src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`; - } - request( { method: "GET", url: src }, (err, response, body) => { @@ -71,11 +71,21 @@ module.exports = React.createClass({ }, render: function() { - return ( - -
+ if (this.props.teamToken && this.props.teamServerUrl) { + src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`; + return ( +
+