summaryrefslogtreecommitdiffstats
path: root/webapp/components/backstage/installed_incoming_webhooks.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-05-12 11:30:53 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-12 11:30:53 -0400
commitd9f724f959e86e417e274f50b249b39acaf81a79 (patch)
tree3df4b94f1d326c2286496989bfa6b0ec5c4fd322 /webapp/components/backstage/installed_incoming_webhooks.jsx
parent82e6cf785c13443f3496941c3ef884506420c735 (diff)
downloadchat-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_incoming_webhooks.jsx')
-rw-r--r--webapp/components/backstage/installed_incoming_webhooks.jsx15
1 files changed, 10 insertions, 5 deletions
diff --git a/webapp/components/backstage/installed_incoming_webhooks.jsx b/webapp/components/backstage/installed_incoming_webhooks.jsx
index 389f65919..0a38a6ab5 100644
--- a/webapp/components/backstage/installed_incoming_webhooks.jsx
+++ b/webapp/components/backstage/installed_incoming_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';
@@ -19,16 +20,18 @@ export default class InstalledIncomingWebhooks extends React.Component {
this.deleteIncomingWebhook = this.deleteIncomingWebhook.bind(this);
+ const teamId = TeamStore.getCurrentId();
+
this.state = {
- incomingWebhooks: IntegrationStore.getIncomingWebhooks(),
- loading: !IntegrationStore.hasReceivedIncomingWebhooks()
+ incomingWebhooks: IntegrationStore.getIncomingWebhooks(teamId),
+ loading: !IntegrationStore.hasReceivedIncomingWebhooks(teamId)
};
}
componentDidMount() {
IntegrationStore.addChangeListener(this.handleIntegrationChange);
- if (window.mm_config.EnableIncomingWebhooks === 'true' && this.state.loading) {
+ if (window.mm_config.EnableIncomingWebhooks === 'true') {
AsyncClient.listIncomingHooks();
}
}
@@ -38,9 +41,11 @@ export default class InstalledIncomingWebhooks extends React.Component {
}
handleIntegrationChange() {
+ const teamId = TeamStore.getCurrentId();
+
this.setState({
- incomingWebhooks: IntegrationStore.getIncomingWebhooks(),
- loading: !IntegrationStore.hasReceivedIncomingWebhooks()
+ incomingWebhooks: IntegrationStore.getIncomingWebhooks(teamId),
+ loading: !IntegrationStore.hasReceivedIncomingWebhooks(teamId)
});
}