diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-12 11:30:53 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-12 11:30:53 -0400 |
commit | d9f724f959e86e417e274f50b249b39acaf81a79 (patch) | |
tree | 3df4b94f1d326c2286496989bfa6b0ec5c4fd322 /webapp/components/backstage/installed_commands.jsx | |
parent | 82e6cf785c13443f3496941c3ef884506420c735 (diff) | |
download | chat-d9f724f959e86e417e274f50b249b39acaf81a79.tar.gz chat-d9f724f959e86e417e274f50b249b39acaf81a79.tar.bz2 chat-d9f724f959e86e417e274f50b249b39acaf81a79.zip |
PLT-2927/PLT-2924 Fixing issues with integration lists (#2974)
* Changed IntegrationStore to store integrations by team
* Fixed regenerating a command's token not causing the UI to update
* Re-added IntegrationStore.hasReceived methods
Diffstat (limited to 'webapp/components/backstage/installed_commands.jsx')
-rw-r--r-- | webapp/components/backstage/installed_commands.jsx | 15 |
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) }); } |