@chromahq/react 1.0.30 → 1.0.31

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -564,6 +564,12 @@ const BridgeProvider = ({
564
564
  connect();
565
565
  }, [connect, updateStatus]);
566
566
  useEffect(() => {
567
+ if (portRef.current || isConnectingRef.current) {
568
+ {
569
+ console.log("[Bridge] Lifecycle: Connection already exists, skipping connect()");
570
+ }
571
+ return;
572
+ }
567
573
  connect();
568
574
  const handleVisibilityChange = () => {
569
575
  if (document.visibilityState !== "visible") return;
@@ -600,7 +606,7 @@ const BridgeProvider = ({
600
606
  clearTimeoutSafe(maxRetryCooldownRef);
601
607
  cleanup(false);
602
608
  };
603
- }, [connect, cleanup]);
609
+ }, []);
604
610
  const contextValue = useMemo(
605
611
  () => ({ bridge, status, error, reconnect, isServiceWorkerAlive }),
606
612
  [bridge, status, error, reconnect, isServiceWorkerAlive]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromahq/react",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "React bindings for the Chroma Chrome extension framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",