summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-06-27 08:08:48 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-06-27 08:08:48 -0400
commit5c70635bcd60f9082e7f69e27e7d45dcb4143c1b (patch)
tree801f170cef3fd1ad589e99f89f478433d22cbbd0 /webapp/components/admin_console
parent11afa405ba4ee6a9d1f17fb99db19ddfed1c385c (diff)
downloadchat-5c70635bcd60f9082e7f69e27e7d45dcb4143c1b.tar.gz
chat-5c70635bcd60f9082e7f69e27e7d45dcb4143c1b.tar.bz2
chat-5c70635bcd60f9082e7f69e27e7d45dcb4143c1b.zip
Fixed switching between user lists in system console (#3409)
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r--webapp/components/admin_console/admin_console.jsx1
-rw-r--r--webapp/components/admin_console/team_users.jsx20
2 files changed, 17 insertions, 4 deletions
diff --git a/webapp/components/admin_console/admin_console.jsx b/webapp/components/admin_console/admin_console.jsx
index 682dbdeda..5b6909e34 100644
--- a/webapp/components/admin_console/admin_console.jsx
+++ b/webapp/components/admin_console/admin_console.jsx
@@ -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';
diff --git a/webapp/components/admin_console/team_users.jsx b/webapp/components/admin_console/team_users.jsx
index 30e35b311..b6bba3182 100644
--- a/webapp/components/admin_console/team_users.jsx
+++ b/webapp/components/admin_console/team_users.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;