Allow team server config to be missing

, default to welcome page if either the teamToken or teamServerURL is undefined.
pull/4024/head
Luke Barnard 2017-05-25 14:35:59 +01:00
parent 2fde2d58b6
commit 41e7706bc6
1 changed files with 4 additions and 4 deletions

View File

@ -25,9 +25,9 @@ module.exports = React.createClass({
displayName: 'HomePage', displayName: 'HomePage',
propTypes: { propTypes: {
// URL base of the team server. // URL base of the team server. Optional.
teamServerUrl: React.PropTypes.string.isRequired, teamServerUrl: React.PropTypes.string,
// Team token. Optional. If set, used as to get the static homepage of the team // Team token. Optional. If set, used to get the static homepage of the team
// associated. If unset, homePageUrl will be used. // associated. If unset, homePageUrl will be used.
teamToken: React.PropTypes.string, teamToken: React.PropTypes.string,
// URL to use as the iFrame src. Defaults to /home.html. // URL to use as the iFrame src. Defaults to /home.html.
@ -37,7 +37,7 @@ module.exports = React.createClass({
render: function() { render: function() {
let src = this.props.homePageUrl || '/home.html'; 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`; src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`;
} }