diff options
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(); |