@liberfi.io/react-predict 0.1.67 → 0.1.69
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{server-DDzzly1V.d.mts → server-HRO1ViL3.d.mts} +2 -0
- package/dist/{server-DDzzly1V.d.ts → server-HRO1ViL3.d.ts} +2 -0
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +2 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -505,7 +505,7 @@ var PredictWsClient = class {
|
|
|
505
505
|
this.reconnectMax = config.reconnectMaxInterval ?? DEFAULT_RECONNECT_MAX;
|
|
506
506
|
this.pingMs = config.pingInterval ?? DEFAULT_PING_INTERVAL;
|
|
507
507
|
this.pongTimeoutMs = config.pongTimeout ?? DEFAULT_PONG_TIMEOUT;
|
|
508
|
-
if (config.autoConnect !== false) {
|
|
508
|
+
if (config.autoConnect !== false && typeof window !== "undefined") {
|
|
509
509
|
this.connect();
|
|
510
510
|
}
|
|
511
511
|
}
|
|
@@ -513,6 +513,7 @@ var PredictWsClient = class {
|
|
|
513
513
|
// Connection management
|
|
514
514
|
// -------------------------------------------------------------------------
|
|
515
515
|
connect() {
|
|
516
|
+
if (typeof window === "undefined") return;
|
|
516
517
|
if (this.ws && (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING)) {
|
|
517
518
|
return;
|
|
518
519
|
}
|