summaryrefslogtreecommitdiffstats
path: root/webapp/stores/integration_store.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/stores/integration_store.jsx')
-rw-r--r--webapp/stores/integration_store.jsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/webapp/stores/integration_store.jsx b/webapp/stores/integration_store.jsx
index 33680452b..34da3751a 100644
--- a/webapp/stores/integration_store.jsx
+++ b/webapp/stores/integration_store.jsx
@@ -57,6 +57,20 @@ class IntegrationStore extends EventEmitter {
this.setIncomingWebhooks(teamId, incomingWebhooks);
}
+ updateIncomingWebhook(incomingWebhook) {
+ const teamId = incomingWebhook.team_id;
+ const incomingWebhooks = this.getIncomingWebhooks(teamId);
+
+ for (let i = 0; i < incomingWebhooks.length; i++) {
+ if (incomingWebhooks[i].id === incomingWebhook.id) {
+ incomingWebhooks[i] = incomingWebhook;
+ break;
+ }
+ }
+
+ this.setIncomingWebhooks(teamId, incomingWebhooks);
+ }
+
removeIncomingWebhook(teamId, id) {
let incomingWebhooks = this.getIncomingWebhooks(teamId);
@@ -200,6 +214,10 @@ class IntegrationStore extends EventEmitter {
this.addIncomingWebhook(action.incomingWebhook);
this.emitChange();
break;
+ case ActionTypes.UPDATED_INCOMING_WEBHOOK:
+ this.updateIncomingWebhook(action.incomingWebhook);
+ this.emitChange();
+ break;
case ActionTypes.REMOVED_INCOMING_WEBHOOK:
this.removeIncomingWebhook(action.teamId, action.id);
this.emitChange();