@chromahq/react 1.0.30 → 1.0.32
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.js +7 -1
- 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
|
-
}, [
|
|
609
|
+
}, []);
|
|
604
610
|
const contextValue = useMemo(
|
|
605
611
|
() => ({ bridge, status, error, reconnect, isServiceWorkerAlive }),
|
|
606
612
|
[bridge, status, error, reconnect, isServiceWorkerAlive]
|