mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Properly updated FilteredUserList when the provided user list is changed (#2983)
This commit is contained in:
committed by
Corey Hulen
parent
9a701b7e5b
commit
94f8be51f9
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user