summaryrefslogtreecommitdiffstats
path: root/webapp/components/backstage/installed_commands.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/backstage/installed_commands.jsx')
-rw-r--r--webapp/components/backstage/installed_commands.jsx15
1 files changed, 10 insertions, 5 deletions
diff --git a/webapp/components/backstage/installed_commands.jsx b/webapp/components/backstage/installed_commands.jsx
index 71373e077..df1f56687 100644
--- a/webapp/components/backstage/installed_commands.jsx
+++ b/webapp/components/backstage/installed_commands.jsx
@@ -5,6 +5,7 @@ import React from 'react';
import * as AsyncClient from 'utils/async_client.jsx';
import IntegrationStore from 'stores/integration_store.jsx';
+import TeamStore from 'stores/team_store.jsx';
import * as Utils from 'utils/utils.jsx';
import {FormattedMessage} from 'react-intl';
@@ -20,16 +21,18 @@ export default class InstalledCommands extends React.Component {
this.regenCommandToken = this.regenCommandToken.bind(this);
this.deleteCommand = this.deleteCommand.bind(this);
+ const teamId = TeamStore.getCurrentId();
+
this.state = {
- commands: IntegrationStore.getCommands(),
- loading: !IntegrationStore.hasReceivedCommands()
+ commands: IntegrationStore.getCommands(teamId),
+ loading: !IntegrationStore.hasReceivedCommands(teamId)
};
}
componentDidMount() {
IntegrationStore.addChangeListener(this.handleIntegrationChange);
- if (window.mm_config.EnableCommands === 'true' && this.state.loading) {
+ if (window.mm_config.EnableCommands === 'true') {
AsyncClient.listTeamCommands();
}
}
@@ -39,9 +42,11 @@ export default class InstalledCommands extends React.Component {
}
handleIntegrationChange() {
+ const teamId = TeamStore.getCurrentId();
+
this.setState({
- commands: IntegrationStore.getCommands(),
- loading: !IntegrationStore.hasReceivedCommands()
+ commands: IntegrationStore.getCommands(teamId),
+ loading: !IntegrationStore.hasReceivedCommands(teamId)
});
}