Skip to content

Commit

Permalink
fix resubscribe, addresses #46 and #62 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia authored Aug 7, 2018
1 parent cbbda0c commit b968618
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/centrifuge.js
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,8 @@ centrifugeProto._subscribe = function (sub) {
this._subs[channel] = sub;
}

this._noResubscribe = false;

if (!this.isConnected()) {
// subscribe will be called later
sub._setNew();
Expand Down Expand Up @@ -1059,8 +1061,8 @@ centrifugeProto._unsubscribeResponse = function (message) {

if (!errorExists(message)) {
if (!uid) {
// unsubscribe command from server – unsubscribe all current subs
sub._setUnsubscribed();
// unsubscribe command from server
sub._setUnsubscribed(true);
}
// ignore client initiated successful unsubscribe responses as we
// already unsubscribed on client level.
Expand Down

0 comments on commit b968618

Please sign in to comment.