cross-tab-worker-databus 0.1.0 → 0.1.1

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.
@@ -5010,7 +5010,11 @@ var CentrifugeSession = class {
5010
5010
  client.on("connected", () => this.post({ type: "STATUS", status: "connected" }));
5011
5011
  client.on("disconnected", () => this.post({ type: "STATUS", status: "disconnected" }));
5012
5012
  client.on("error", (context) => this.postError(context));
5013
- client.on("publication", (context) => this.postPublication(context.channel || getPayloadTopic(context.data), context.data));
5013
+ client.on("publication", (context) => {
5014
+ const topic = context.channel || getPayloadTopic(context.data);
5015
+ if (!topic || this.subscriptions.has(topic)) return;
5016
+ this.postPublication(topic, context.data);
5017
+ });
5014
5018
  client.connect();
5015
5019
  }
5016
5020
  /** Subscribe to a Centrifuge channel. Reuses an existing subscription if one exists. */