mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixed switching between user lists in system console (#3409)
This commit is contained in:
committed by
Joram Wilander
parent
11afa405ba
commit
5c70635bcd
@@ -2,6 +2,7 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import 'bootstrap';
|
||||
|
||||
import ErrorBar from 'components/error_bar.jsx';
|
||||
import AdminStore from 'stores/admin_store.jsx';
|
||||
|
||||
@@ -43,6 +43,22 @@ export default class UserList extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.getCurrentTeamProfiles();
|
||||
|
||||
AdminStore.addAllTeamsChangeListener(this.onAllTeamsChange);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.params.team !== this.props.params.team) {
|
||||
this.setState({
|
||||
team: AdminStore.getTeam(nextProps.params.team)
|
||||
});
|
||||
|
||||
this.getTeamProfiles(nextProps.params.team);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
AdminStore.removeAllTeamsChangeListener(this.onAllTeamsChange);
|
||||
}
|
||||
|
||||
onAllTeamsChange() {
|
||||
@@ -144,10 +160,6 @@ export default class UserList extends React.Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps) {
|
||||
this.getTeamProfiles(newProps.params.team);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (!this.state.team) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user