Skip to content

Commit 7269e7b

Browse files
author
Luke Barnard
committed
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.
1 parent ee2fb17 commit 7269e7b

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

‎src/components/structures/RightPanel.js‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ module.exports = React.createClass({
3131
displayName: 'RightPanel',
3232

3333
propTypes: {
34-
userId: React.PropTypes.string, // if showing an orphaned MemberInfo page, this is set
3534
roomId: React.PropTypes.string, // if showing panels for a given room, this is set
3635
collapsed: React.PropTypes.bool, // currently unused property to request for a minimized view of the panel
3736
},
@@ -57,17 +56,9 @@ module.exports = React.createClass({
5756
},
5857

5958
getInitialState: function() {
60-
if (this.props.userId) {
61-
var member = new Matrix.RoomMember(null, this.props.userId);
62-
return {
63-
phase: this.Phase.MemberInfo,
64-
member: member,
65-
};
66-
} else {
67-
return {
68-
phase: this.Phase.MemberList
69-
};
70-
}
59+
return {
60+
phase: this.Phase.MemberList
61+
};
7162
},
7263

7364
onMemberListButtonClick: function() {
@@ -229,7 +220,7 @@ module.exports = React.createClass({
229220
}
230221
else if(this.state.phase == this.Phase.MemberInfo) {
231222
var MemberInfo = sdk.getComponent('rooms.MemberInfo');
232-
panel = <MemberInfo member={this.state.member} key={this.props.roomId || this.props.userId} />
223+
panel = <MemberInfo member={this.state.member} key={this.props.roomId || this.state.member.userId} />
233224
}
234225
else if (this.state.phase == this.Phase.NotificationPanel) {
235226
panel = <NotificationPanel />

0 commit comments

Comments
 (0)