Fixed switching between user lists in system console (#3409)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
11afa405ba
Коммит
5c70635bcd
@@ -2,6 +2,7 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import 'bootstrap';
|
||||||
|
|
||||||
import ErrorBar from 'components/error_bar.jsx';
|
import ErrorBar from 'components/error_bar.jsx';
|
||||||
import AdminStore from 'stores/admin_store.jsx';
|
import AdminStore from 'stores/admin_store.jsx';
|
||||||
|
|||||||
@@ -43,6 +43,22 @@ export default class UserList extends React.Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.getCurrentTeamProfiles();
|
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() {
|
onAllTeamsChange() {
|
||||||
@@ -144,10 +160,6 @@ export default class UserList extends React.Component {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps) {
|
|
||||||
this.getTeamProfiles(newProps.params.team);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (!this.state.team) {
|
if (!this.state.team) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user