From 7269e7b84a7902f850c6e91fc55336d844d44772 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 10 Aug 2017 13:16:31 +0100 Subject: [PATCH 1/2] Remove userId property on RightPanel because we shouldn't have a dispatch AND have a property that do vaguely similar things. Ideally, the dispatch would send a userId and RP would do async work to get the member/avatar/displayname. --- src/components/structures/RightPanel.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 6c5c1fe1c4..0fae1bc032 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -31,7 +31,6 @@ module.exports = React.createClass({ displayName: 'RightPanel', propTypes: { - userId: React.PropTypes.string, // if showing an orphaned MemberInfo page, this is set roomId: React.PropTypes.string, // if showing panels for a given room, this is set collapsed: React.PropTypes.bool, // currently unused property to request for a minimized view of the panel }, @@ -57,17 +56,9 @@ module.exports = React.createClass({ }, getInitialState: function() { - if (this.props.userId) { - var member = new Matrix.RoomMember(null, this.props.userId); - return { - phase: this.Phase.MemberInfo, - member: member, - }; - } else { - return { - phase: this.Phase.MemberList - }; - } + return { + phase: this.Phase.MemberList + }; }, onMemberListButtonClick: function() { @@ -229,7 +220,7 @@ module.exports = React.createClass({ } else if(this.state.phase == this.Phase.MemberInfo) { var MemberInfo = sdk.getComponent('rooms.MemberInfo'); - panel = + panel = } else if (this.state.phase == this.Phase.NotificationPanel) { panel = From 44c6f3fafc0c2ec2efafd5379f4161a4c752cd11 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 10 Aug 2017 16:59:12 +0100 Subject: [PATCH 2/2] Add todo to make RP listen to RVS --- src/components/structures/RightPanel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 0fae1bc032..9120de8c0e 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -31,6 +31,7 @@ module.exports = React.createClass({ displayName: 'RightPanel', propTypes: { + // TODO: This should not be a prop, it should be received from the RoomViewStore roomId: React.PropTypes.string, // if showing panels for a given room, this is set collapsed: React.PropTypes.bool, // currently unused property to request for a minimized view of the panel },