@electric-sql/client 1.5.8 → 1.5.9

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.
package/dist/index.mjs CHANGED
@@ -2019,7 +2019,6 @@ var ShapeStream = class {
2019
2019
  ));
2020
2020
  __privateSet(this, _fetchClient2, createFetchWithConsumedMessages(__privateGet(this, _sseFetchClient)));
2021
2021
  __privateMethod(this, _ShapeStream_instances, subscribeToVisibilityChanges_fn).call(this);
2022
- __privateMethod(this, _ShapeStream_instances, subscribeToWakeDetection_fn).call(this);
2023
2022
  }
2024
2023
  get shapeHandle() {
2025
2024
  return __privateGet(this, _syncState).handle;
@@ -2269,6 +2268,7 @@ _fastLoopMaxCount = new WeakMap();
2269
2268
  start_fn = async function() {
2270
2269
  var _a, _b;
2271
2270
  __privateSet(this, _started, true);
2271
+ __privateMethod(this, _ShapeStream_instances, subscribeToWakeDetection_fn).call(this);
2272
2272
  try {
2273
2273
  await __privateMethod(this, _ShapeStream_instances, requestShape_fn).call(this);
2274
2274
  } catch (err) {
@@ -2822,6 +2822,7 @@ subscribeToVisibilityChanges_fn = function() {
2822
2822
  document.addEventListener(`visibilitychange`, visibilityHandler);
2823
2823
  __privateSet(this, _unsubscribeFromVisibilityChanges, () => {
2824
2824
  document.removeEventListener(`visibilitychange`, visibilityHandler);
2825
+ __privateSet(this, _unsubscribeFromVisibilityChanges, void 0);
2825
2826
  });
2826
2827
  }
2827
2828
  };
@@ -2839,6 +2840,7 @@ subscribeToVisibilityChanges_fn = function() {
2839
2840
  */
2840
2841
  subscribeToWakeDetection_fn = function() {
2841
2842
  if (__privateMethod(this, _ShapeStream_instances, hasBrowserVisibilityAPI_fn).call(this)) return;
2843
+ if (__privateGet(this, _unsubscribeFromWakeDetection)) return;
2842
2844
  const INTERVAL_MS = 2e3;
2843
2845
  const WAKE_THRESHOLD_MS = 4e3;
2844
2846
  let lastTickTime = Date.now();
@@ -2861,6 +2863,7 @@ subscribeToWakeDetection_fn = function() {
2861
2863
  }
2862
2864
  __privateSet(this, _unsubscribeFromWakeDetection, () => {
2863
2865
  clearInterval(timer);
2866
+ __privateSet(this, _unsubscribeFromWakeDetection, void 0);
2864
2867
  });
2865
2868
  };
2866
2869
  /**