From c123f028422941656c9343444e2b7af5fb944a7d Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 8 Jun 2016 18:45:46 +0100 Subject: [PATCH 1/2] Make the config optional --- src/components/structures/MatrixChat.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 7f7bf034b8..9d0b383c0a 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -41,7 +41,7 @@ module.exports = React.createClass({ displayName: 'MatrixChat', propTypes: { - config: React.PropTypes.object.isRequired, + config: React.PropTypes.object, ConferenceHandler: React.PropTypes.any, onNewScreen: React.PropTypes.func, registrationUrl: React.PropTypes.string, @@ -84,7 +84,8 @@ module.exports = React.createClass({ getDefaultProps: function() { return { - startingQueryParams: {} + startingQueryParams: {}, + config: {}, }; }, From 05404efa344e6cad39a371b2aa567335954e7ab6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 9 Jun 2016 09:53:37 +0100 Subject: [PATCH 2/2] Remove if (this.props.config) Since it now defaults to the empty dictionary (and if you pass null in, you deserve everything you get). --- src/components/structures/MatrixChat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 9d0b383c0a..cca7d1fd9f 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -98,7 +98,7 @@ module.exports = React.createClass({ else if (window.localStorage && window.localStorage.getItem("mx_hs_url")) { return window.localStorage.getItem("mx_hs_url"); } - else if (this.props.config) { + else { return this.props.config.default_hs_url } return "https://matrix.org"; @@ -117,7 +117,7 @@ module.exports = React.createClass({ else if (window.localStorage && window.localStorage.getItem("mx_is_url")) { return window.localStorage.getItem("mx_is_url"); } - else if (this.props.config) { + else { return this.props.config.default_is_url } return "https://matrix.org";