diff options
Diffstat (limited to 'webapp/components/backstage/installed_outgoing_webhooks.jsx')
-rw-r--r-- | webapp/components/backstage/installed_outgoing_webhooks.jsx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/webapp/components/backstage/installed_outgoing_webhooks.jsx b/webapp/components/backstage/installed_outgoing_webhooks.jsx index e0817fda8..b79bc3530 100644 --- a/webapp/components/backstage/installed_outgoing_webhooks.jsx +++ b/webapp/components/backstage/installed_outgoing_webhooks.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 InstalledOutgoingWebhooks extends React.Component { this.regenOutgoingWebhookToken = this.regenOutgoingWebhookToken.bind(this); this.deleteOutgoingWebhook = this.deleteOutgoingWebhook.bind(this); + const teamId = TeamStore.getCurrentId(); + this.state = { - outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(), - loading: !IntegrationStore.hasReceivedOutgoingWebhooks() + outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(teamId), + loading: !IntegrationStore.hasReceivedOutgoingWebhooks(teamId) }; } componentDidMount() { IntegrationStore.addChangeListener(this.handleIntegrationChange); - if (window.mm_config.EnableOutgoingWebhooks === 'true' && this.state.loading) { + if (window.mm_config.EnableOutgoingWebhooks === 'true') { AsyncClient.listOutgoingHooks(); } } @@ -39,9 +42,11 @@ export default class InstalledOutgoingWebhooks extends React.Component { } handleIntegrationChange() { + const teamId = TeamStore.getCurrentId(); + this.setState({ - outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(), - loading: !IntegrationStore.hasReceivedOutgoingWebhooks() + outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(teamId), + loading: !IntegrationStore.hasReceivedOutgoingWebhooks(teamId) }); } |