Skip to content

Commit

Permalink
patch for multi- subscribe issue (PR ryanb#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryleto committed Feb 16, 2016
1 parent 67b72e7 commit 282ae2d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/assets/javascripts/private_pub.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ function buildPrivatePub(doc) {
if (!self.subscriptions.server) {
self.subscriptions.server = options.server;
}
self.subscriptions[options.channel] = options;
self.faye(function(faye) {
var sub = faye.subscribe(options.channel, self.handleResponse);
self.subscriptionObjects[options.channel] = sub;
if (options.subscription) {
options.subscription(sub);
}
});
if (!self.subscriptions[options.channel]) {
self.subscriptions[options.channel] = options;
self.faye(function(faye) {
faye.subscribe(options.channel, self.handleResponse);
});
}
},

handleResponse: function(message) {
Expand Down

0 comments on commit 282ae2d

Please sign in to comment.