From b9870f2c235facaa32e5fb45b8bf7b7349e5dfb8 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 12 Aug 2016 11:41:06 +0100 Subject: [PATCH] defaultDeviceDisplayName should be a prop ... not a bit of config. --- src/components/structures/MatrixChat.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 4844faa03d..8d84cbf7d0 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -58,6 +58,10 @@ module.exports = React.createClass({ // called when the session load completes onLoadCompleted: React.PropTypes.func, + + // displayname, if any, to set on the device when logging + // in/registering. + defaultDeviceDisplayName: React.PropTypes.string, }, PageTypes: { @@ -185,7 +189,7 @@ module.exports = React.createClass({ enableGuest: this.props.enableGuest, guestHsUrl: this.getCurrentHsUrl(), guestIsUrl: this.getCurrentIsUrl(), - defaultDisplayName: this.props.config.default_device_name, + defaultDeviceDisplayName: this.props.defaultDeviceDisplayName, }).done(()=>{ // stuff this through the dispatcher so that it happens // after the on_logged_in action. @@ -1040,7 +1044,7 @@ module.exports = React.createClass({ customHsUrl={this.getCurrentHsUrl()} customIsUrl={this.getCurrentIsUrl()} registrationUrl={this.props.registrationUrl} - defaultDeviceDisplayName={this.props.config.default_device_name} + defaultDeviceDisplayName={this.props.defaultDeviceDisplayName} onLoggedIn={this.onRegistered} onLoginClick={this.onLoginClick} onRegisterClick={this.onRegisterClick} @@ -1067,7 +1071,7 @@ module.exports = React.createClass({ customHsUrl={this.getCurrentHsUrl()} customIsUrl={this.getCurrentIsUrl()} fallbackHsUrl={this.getFallbackHsUrl()} - defaultDeviceDisplayName={this.props.config.default_device_name} + defaultDeviceDisplayName={this.props.defaultDeviceDisplayName} onForgotPasswordClick={this.onForgotPasswordClick} enableGuest={this.props.enableGuest} onCancelClick={this.guestCreds ? this.onReturnToGuestClick : null}