Skip to content

Commit

Permalink
Merge pull request #45 from kuzzleio/subscribeBugFix
Browse files Browse the repository at this point in the history
Offline subscription bug fix
  • Loading branch information
scottinet committed Jan 27, 2016
2 parents b8c42c6 + f73c44e commit 1018cbe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
9 changes: 4 additions & 5 deletions dist/kuzzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2671,6 +2671,10 @@ KuzzleRoom.prototype.renew = function (filters, cb) {
filters = null;
}

if (filters) {
this.filters = filters;
}

/*
if not yet connected, register itself to the subscriptions list and wait for the
main Kuzzle object to renew once online
Expand All @@ -2681,7 +2685,6 @@ KuzzleRoom.prototype.renew = function (filters, cb) {
return this;
}


if (this.subscribing) {
this.queue.push({action: 'renew', args: [filters, cb]});
return this;
Expand All @@ -2695,10 +2698,6 @@ KuzzleRoom.prototype.renew = function (filters, cb) {
this.callback = cb;
this.kuzzle.subscriptions.pending[self.id] = self;

if (filters) {
this.filters = filters;
}

subscribeQuery.body = this.filters;
subscribeQuery = this.kuzzle.addHeaders(subscribeQuery, this.headers);

Expand Down
4 changes: 2 additions & 2 deletions dist/kuzzle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/kuzzle.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kuzzle-sdk",
"version": "1.3.6",
"version": "1.3.7",
"description": "Official Javascript SDK for Kuzzle",
"author": "The Kuzzle Team <support@kuzzle.io>",
"repository": {
Expand Down
9 changes: 4 additions & 5 deletions src/kuzzleRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ KuzzleRoom.prototype.renew = function (filters, cb) {
filters = null;
}

if (filters) {
this.filters = filters;
}

/*
if not yet connected, register itself to the subscriptions list and wait for the
main Kuzzle object to renew once online
Expand All @@ -165,7 +169,6 @@ KuzzleRoom.prototype.renew = function (filters, cb) {
return this;
}


if (this.subscribing) {
this.queue.push({action: 'renew', args: [filters, cb]});
return this;
Expand All @@ -179,10 +182,6 @@ KuzzleRoom.prototype.renew = function (filters, cb) {
this.callback = cb;
this.kuzzle.subscriptions.pending[self.id] = self;

if (filters) {
this.filters = filters;
}

subscribeQuery.body = this.filters;
subscribeQuery = this.kuzzle.addHeaders(subscribeQuery, this.headers);

Expand Down

0 comments on commit 1018cbe

Please sign in to comment.