Skip to content

Commit

Permalink
Correct when we register event listeners for acceptByJob
Browse files Browse the repository at this point in the history
  • Loading branch information
iarna committed Jul 14, 2014
1 parent 9fca9e4 commit 103d2d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packet-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ PacketHandler.prototype.unacceptSerial = function (event, callback) {
}

PacketHandler.prototype.acceptByJob = function (event, id, callback) {
if (!this.mapped[event]) this.mapped[event] = {};
if (!this.mapped[event][id]) {
if (!this.mapped[event]) {
this.mapped[event] = {};
this.on(event, this.acceptByJobEventListener);
this.mapped[event][id] = [];
}
if (!this.mapped[event][id]) this.mapped[event][id] = [];
this.mapped[event][id].push(callback);
}

Expand Down

0 comments on commit 103d2d3

Please sign in to comment.