diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-12 21:35:55 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-05-12 18:35:55 -0700 |
commit | 94f8be51f91203d5d6ccbd99dd721b7e945791bf (patch) | |
tree | 28c5ca32f52624f756826a1658fad84249b6284c /webapp/components | |
parent | 9a701b7e5b31ca803a2d92f0b3b1d7cc68bf3c37 (diff) | |
download | chat-94f8be51f91203d5d6ccbd99dd721b7e945791bf.tar.gz chat-94f8be51f91203d5d6ccbd99dd721b7e945791bf.tar.bz2 chat-94f8be51f91203d5d6ccbd99dd721b7e945791bf.zip |
Properly updated FilteredUserList when the provided user list is changed (#2983)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/filtered_user_list.jsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/webapp/components/filtered_user_list.jsx b/webapp/components/filtered_user_list.jsx index 4270d3731..fca68a81a 100644 --- a/webapp/components/filtered_user_list.jsx +++ b/webapp/components/filtered_user_list.jsx @@ -43,6 +43,15 @@ class FilteredUserList extends React.Component { }; } + componentWillUpdate(nextProps) { + // assume the user list is immutable + if (this.props.users !== nextProps.users) { + this.setState({ + users: this.filterUsers(nextProps.teamMembers, nextProps.users) + }); + } + } + componentDidUpdate(prevProps, prevState) { if (prevState.filter !== this.state.filter) { $(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0); |