Added ability to regenerate outgoing webhook tokens on InstalledIntegrations page

Этот коммит содержится в:
Harrison Healey
2016-03-29 10:04:53 -04:00
родитель fcd8f2e2ba
Коммит 149c72cf8c
5 изменённых файлов: 64 добавлений и 6 удалений

Просмотреть файл

@@ -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();