Skip to content

Commit

Permalink
compiled files
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Presman committed Apr 5, 2017
1 parent 2901251 commit 52ecf5f
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 54 deletions.
22 changes: 11 additions & 11 deletions dist/titanium/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ return /******/ (function(modules) { // webpackBootstrap
this.disconnect = subscriptionManager.disconnect.bind(subscriptionManager);
this.reconnect = subscriptionManager.reconnect.bind(subscriptionManager);

this.destroy = function () {
subscriptionManager.unsubscribeAll();
this.destroy = function (isOffline) {
subscriptionManager.unsubscribeAll(isOffline);
subscriptionManager.disconnect();
};

Expand Down Expand Up @@ -356,19 +356,19 @@ return /******/ (function(modules) { // webpackBootstrap
return this._config.getVersion();
}
}, {
key: '__networkDownDetected',
value: function __networkDownDetected() {
key: 'networkDownDetected',
value: function networkDownDetected() {
this._listenerManager.announceNetworkDown();

if (this._config.restore) {
this.disconnect();
} else {
this.destroy();
this.destroy(true);
}
}
}, {
key: '__networkUpDetected',
value: function __networkUpDetected() {
key: 'networkUpDetected',
value: function networkUpDetected() {
this._listenerManager.announceNetworkUp();
this.reconnect();
}
Expand Down Expand Up @@ -1579,7 +1579,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}, {
key: 'adaptUnsubscribeChange',
value: function adaptUnsubscribeChange(args) {
value: function adaptUnsubscribeChange(args, isOffline) {
var _this3 = this;

var _args$channels3 = args.channels,
Expand All @@ -1598,7 +1598,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (channelGroup in _this3._presenceChannelGroups) delete _this3._channelGroups[channelGroup];
});

if (this._config.suppressLeaveEvents === false) {
if (this._config.suppressLeaveEvents === false && !isOffline) {
this._leaveEndpoint({ channels: channels, channelGroups: channelGroups }, function (status) {
status.affectedChannels = channels;
status.affectedChannelGroups = channelGroups;
Expand All @@ -1619,8 +1619,8 @@ return /******/ (function(modules) { // webpackBootstrap
}
}, {
key: 'unsubscribeAll',
value: function unsubscribeAll() {
this.adaptUnsubscribeChange({ channels: this.getSubscribedChannels(), channelGroups: this.getSubscribedChannelGroups() });
value: function unsubscribeAll(isOffline) {
this.adaptUnsubscribeChange({ channels: this.getSubscribedChannels(), channelGroups: this.getSubscribedChannelGroups() }, isOffline);
}
}, {
key: 'getSubscribedChannels',
Expand Down
6 changes: 3 additions & 3 deletions dist/titanium/pubnub.min.js

Large diffs are not rendered by default.

40 changes: 23 additions & 17 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,25 @@ return /******/ (function(modules) { // webpackBootstrap
function _class(setup) {
_classCallCheck(this, _class);

var _setup$listenToBrowse = setup.listenToBrowserNetworkEvents,
listenToBrowserNetworkEvents = _setup$listenToBrowse === undefined ? true : _setup$listenToBrowse;


setup.db = _web2.default;
setup.sdkFamily = 'Web';
setup.networking = new _networking2.default({ get: _webNode.get, post: _webNode.post, sendBeacon: sendBeacon });

var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, setup));

window.addEventListener('offline', function () {
_this.__networkDownDetected();
});
if (listenToBrowserNetworkEvents) {
window.addEventListener('offline', function () {
_this.networkDownDetected();
});

window.addEventListener('online', function () {
_this.__networkUpDetected();
});
window.addEventListener('online', function () {
_this.networkUpDetected();
});
}
return _this;
}

Expand Down Expand Up @@ -342,8 +348,8 @@ return /******/ (function(modules) { // webpackBootstrap
this.disconnect = subscriptionManager.disconnect.bind(subscriptionManager);
this.reconnect = subscriptionManager.reconnect.bind(subscriptionManager);

this.destroy = function () {
subscriptionManager.unsubscribeAll();
this.destroy = function (isOffline) {
subscriptionManager.unsubscribeAll(isOffline);
subscriptionManager.disconnect();
};

Expand Down Expand Up @@ -372,19 +378,19 @@ return /******/ (function(modules) { // webpackBootstrap
return this._config.getVersion();
}
}, {
key: '__networkDownDetected',
value: function __networkDownDetected() {
key: 'networkDownDetected',
value: function networkDownDetected() {
this._listenerManager.announceNetworkDown();

if (this._config.restore) {
this.disconnect();
} else {
this.destroy();
this.destroy(true);
}
}
}, {
key: '__networkUpDetected',
value: function __networkUpDetected() {
key: 'networkUpDetected',
value: function networkUpDetected() {
this._listenerManager.announceNetworkUp();
this.reconnect();
}
Expand Down Expand Up @@ -1595,7 +1601,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}, {
key: 'adaptUnsubscribeChange',
value: function adaptUnsubscribeChange(args) {
value: function adaptUnsubscribeChange(args, isOffline) {
var _this3 = this;

var _args$channels3 = args.channels,
Expand All @@ -1614,7 +1620,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (channelGroup in _this3._presenceChannelGroups) delete _this3._channelGroups[channelGroup];
});

if (this._config.suppressLeaveEvents === false) {
if (this._config.suppressLeaveEvents === false && !isOffline) {
this._leaveEndpoint({ channels: channels, channelGroups: channelGroups }, function (status) {
status.affectedChannels = channels;
status.affectedChannelGroups = channelGroups;
Expand All @@ -1635,8 +1641,8 @@ return /******/ (function(modules) { // webpackBootstrap
}
}, {
key: 'unsubscribeAll',
value: function unsubscribeAll() {
this.adaptUnsubscribeChange({ channels: this.getSubscribedChannels(), channelGroups: this.getSubscribedChannelGroups() });
value: function unsubscribeAll(isOffline) {
this.adaptUnsubscribeChange({ channels: this.getSubscribedChannels(), channelGroups: this.getSubscribedChannelGroups() }, isOffline);
}
}, {
key: 'getSubscribedChannels',
Expand Down
6 changes: 3 additions & 3 deletions dist/web/pubnub.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/core/components/subscription_manager.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/core/components/subscription_manager.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions lib/core/pubnub-common.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 52ecf5f

Please sign in to comment.