You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Fix some react warnings in GroupMemberList
- If the list contains two users twice, react would warn about duplicate keys. Use `index` instead. - Check if unmounted before setting state after fetching members.
This commit is contained in:
@@ -59,6 +59,7 @@ export default withMatrixClient(React.createClass({
|
||||
},
|
||||
|
||||
_fetchMembers: function() {
|
||||
if (this._unmounted) return;
|
||||
this.setState({
|
||||
members: this._groupStore.getGroupMembers(),
|
||||
invitedMembers: this._groupStore.getGroupInvitedMembers(),
|
||||
@@ -105,9 +106,9 @@ export default withMatrixClient(React.createClass({
|
||||
});
|
||||
}
|
||||
|
||||
memberList = memberList.map((m) => {
|
||||
memberList = memberList.map((m, index) => {
|
||||
return (
|
||||
<GroupMemberTile key={m.userId} groupId={this.props.groupId} member={m} />
|
||||
<GroupMemberTile key={index} groupId={this.props.groupId} member={m} />
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user