From 93963ee2bc955633abc39409c32bb77b30fffd91 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Thu, 8 Oct 2015 11:30:06 +0100 Subject: [PATCH] Bug 1212348 - Loop's RoomList view requires user profile data passed in when it doesn't need to. r=mikedeboer --- browser/components/loop/content/js/panel.js | 18 ++++-------------- browser/components/loop/content/js/panel.jsx | 18 ++++-------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/browser/components/loop/content/js/panel.js b/browser/components/loop/content/js/panel.js index fa74e0d85527..0bedff7a1594 100644 --- a/browser/components/loop/content/js/panel.js +++ b/browser/components/loop/content/js/panel.js @@ -668,9 +668,7 @@ loop.panel = (function(_, mozL10n) { propTypes: { dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, mozLoop: React.PropTypes.object.isRequired, - store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired, - // Used for room creation, associated with room owner. - userProfile: userProfileValidator + store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired }, getInitialState: function() { @@ -703,11 +701,6 @@ loop.panel = (function(_, mozL10n) { this.setState(this.props.store.getStoreState()); }, - _getUserDisplayName: function() { - return this.props.userProfile && this.props.userProfile.email || - mozL10n.get("display_name_guest"); - }, - /** * Let the user know we're loading rooms * @returns {Object} React render @@ -746,8 +739,7 @@ loop.panel = (function(_, mozL10n) { React.createElement(NewRoomView, {dispatcher: this.props.dispatcher, mozLoop: this.props.mozLoop, pendingOperation: this.state.pendingCreation || - this.state.pendingInitialRetrieval, - userDisplayName: this._getUserDisplayName()}) + this.state.pendingInitialRetrieval}) ); }, @@ -792,8 +784,7 @@ loop.panel = (function(_, mozL10n) { propTypes: { dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, mozLoop: React.PropTypes.object.isRequired, - pendingOperation: React.PropTypes.bool.isRequired, - userDisplayName: React.PropTypes.string.isRequired + pendingOperation: React.PropTypes.bool.isRequired }, mixins: [ @@ -1002,8 +993,7 @@ loop.panel = (function(_, mozL10n) { notifications: this.props.notifications}), React.createElement(RoomList, {dispatcher: this.props.dispatcher, mozLoop: this.props.mozLoop, - store: this.props.roomStore, - userProfile: this.state.userProfile}), + store: this.props.roomStore}), React.createElement("div", {className: "footer"}, React.createElement("div", {className: "user-details"}, React.createElement(AvailabilityDropdown, null) diff --git a/browser/components/loop/content/js/panel.jsx b/browser/components/loop/content/js/panel.jsx index ae133b8a7ca3..f391952bddaa 100644 --- a/browser/components/loop/content/js/panel.jsx +++ b/browser/components/loop/content/js/panel.jsx @@ -668,9 +668,7 @@ loop.panel = (function(_, mozL10n) { propTypes: { dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, mozLoop: React.PropTypes.object.isRequired, - store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired, - // Used for room creation, associated with room owner. - userProfile: userProfileValidator + store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired }, getInitialState: function() { @@ -703,11 +701,6 @@ loop.panel = (function(_, mozL10n) { this.setState(this.props.store.getStoreState()); }, - _getUserDisplayName: function() { - return this.props.userProfile && this.props.userProfile.email || - mozL10n.get("display_name_guest"); - }, - /** * Let the user know we're loading rooms * @returns {Object} React render @@ -746,8 +739,7 @@ loop.panel = (function(_, mozL10n) { + this.state.pendingInitialRetrieval} /> ); }, @@ -792,8 +784,7 @@ loop.panel = (function(_, mozL10n) { propTypes: { dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, mozLoop: React.PropTypes.object.isRequired, - pendingOperation: React.PropTypes.bool.isRequired, - userDisplayName: React.PropTypes.string.isRequired + pendingOperation: React.PropTypes.bool.isRequired }, mixins: [ @@ -1002,8 +993,7 @@ loop.panel = (function(_, mozL10n) { notifications={this.props.notifications} /> + store={this.props.roomStore} />