diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-29 10:04:53 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-29 15:18:48 -0400 |
commit | 149c72cf8c136781864863bf71ae3bf0d516728d (patch) | |
tree | fd128e9ce31f2f2c2afd6657478e91cb92a6fade /webapp/stores/integration_store.jsx | |
parent | fcd8f2e2badc0d314eaba2f1e0360274e0ba9e24 (diff) | |
download | chat-149c72cf8c136781864863bf71ae3bf0d516728d.tar.gz chat-149c72cf8c136781864863bf71ae3bf0d516728d.tar.bz2 chat-149c72cf8c136781864863bf71ae3bf0d516728d.zip |
Added ability to regenerate outgoing webhook tokens on InstalledIntegrations page
Diffstat (limited to 'webapp/stores/integration_store.jsx')
-rw-r--r-- | webapp/stores/integration_store.jsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/webapp/stores/integration_store.jsx b/webapp/stores/integration_store.jsx index bf9f9ba85..abd7e3558 100644 --- a/webapp/stores/integration_store.jsx +++ b/webapp/stores/integration_store.jsx @@ -77,6 +77,15 @@ class IntegrationStore extends EventEmitter { this.outgoingWebhooks.push(outgoingWebhook); } + updateOutgoingWebhook(outgoingWebhook) { + for (let i = 0; i < this.outgoingWebhooks.length; i++) { + if (this.outgoingWebhooks[i].id === outgoingWebhook.id) { + this.outgoingWebhooks[i] = outgoingWebhook; + break; + } + } + } + removeOutgoingWebhook(id) { for (let i = 0; i < this.outgoingWebhooks.length; i++) { if (this.outgoingWebhooks[i].id === id) { @@ -110,6 +119,10 @@ class IntegrationStore extends EventEmitter { this.addOutgoingWebhook(action.outgoingWebhook); this.emitChange(); break; + case ActionTypes.UPDATED_OUTGOING_WEBHOOK: + this.updateOutgoingWebhook(action.outgoingWebhook); + this.emitChange(); + break; case ActionTypes.REMOVED_OUTGOING_WEBHOOK: this.removeOutgoingWebhook(action.id); this.emitChange(); |