Don't trigger several events when the same issue action is repeated;

This commit is contained in:
Benjamin Bouvier 2017-10-14 16:07:11 +02:00
parent dec545136b
commit a7e0aad089

View File

@ -74,6 +74,8 @@ function conjugatePast(verb) {
return verb + (verb.substr(-1) === 'e' ? '' : 'e') + 'd';
}
var lastIssueActions = {};
var handlers = {
push: function(body, say) {
@ -132,6 +134,11 @@ var handlers = {
if (issue.action === 'update')
return;
// Don't trigger several close event.
if (issue.action === lastIssueActions[issue.iid])
return;
lastIssueActions[issue.iid] = issue.action;
var displayedAction = conjugatePast(issue.action);
shortenURL(url, function(shortUrl) {