@mtgame/core 0.2.39 → 0.2.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1383,6 +1383,7 @@
1383
1383
  games_count: 'gamesCount',
1384
1384
  score_sum: 'scoreSum',
1385
1385
  closest_game_datetime: 'closestGameDatetime',
1386
+ created_by_league_id: 'createdByLeagueId',
1386
1387
  },
1387
1388
  relation: {
1388
1389
  sport: exports.Sport,
@@ -13538,6 +13539,7 @@
13538
13539
  CentrifugoService.prototype.unsubscribe = function (channel) {
13539
13540
  if (this.subscriptions[channel]) {
13540
13541
  this.subscriptions[channel].unsubscribe();
13542
+ this.centrifuge.removeSubscription(this.subscriptions[channel]);
13541
13543
  delete this.subscriptions[channel];
13542
13544
  }
13543
13545
  if (this.channels$[channel]) {
@@ -13610,10 +13612,13 @@
13610
13612
  };
13611
13613
  CentrifugoService.prototype.addEngineSubscription = function (channel) {
13612
13614
  var _this = this;
13613
- var sub = this.centrifuge.newSubscription(channel);
13614
- sub.on('publication', function (ctx) {
13615
- _this.resolveMessage(channel, ctx.data);
13616
- });
13615
+ var sub = this.centrifuge.getSubscription(channel);
13616
+ if (!sub) {
13617
+ sub = this.centrifuge.newSubscription(channel);
13618
+ sub.on('publication', function (ctx) {
13619
+ _this.resolveMessage(channel, ctx.data);
13620
+ });
13621
+ }
13617
13622
  sub.subscribe();
13618
13623
  return sub;
13619
13624
  };