Merge pull request #4024 from vector-im/luke/new-guest-access-fix-team-server-no-config

Allow team server config to be missing
This commit is contained in:
Luke Barnard 2017-05-25 15:07:59 +01:00 committed by GitHub
commit 6c1b6f0476

View file

@ -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`;
}