From 41e7706bc6a40695cbea271f1da712d0eae06095 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 25 May 2017 14:35:59 +0100 Subject: [PATCH] Allow team server config to be missing , default to welcome page if either the teamToken or teamServerURL is undefined. --- src/components/structures/HomePage.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index 5518cb95..dfcca0e8 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -25,9 +25,9 @@ module.exports = React.createClass({ displayName: 'HomePage', propTypes: { - // URL base of the team server. - teamServerUrl: React.PropTypes.string.isRequired, - // Team token. Optional. If set, used as to get the static homepage of the team + // URL base of the team server. Optional. + teamServerUrl: React.PropTypes.string, + // Team token. Optional. If set, used to get the static homepage of the team // associated. If unset, homePageUrl will be used. teamToken: React.PropTypes.string, // URL to use as the iFrame src. Defaults to /home.html. @@ -37,7 +37,7 @@ module.exports = React.createClass({ render: function() { let src = this.props.homePageUrl || '/home.html'; - if (this.props.teamToken) { + if (this.props.teamToken && this.props.teamServerUrl) { src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`; }