@bulletxyz/bullet-sdk 0.19.0-rc.0 → 0.19.1-rc.0
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/browser/index.js
CHANGED
|
@@ -7063,8 +7063,12 @@ var WebSocketManager = class {
|
|
|
7063
7063
|
}
|
|
7064
7064
|
async connect() {
|
|
7065
7065
|
if (this.socket?.readyState === WebSocket.OPEN) return;
|
|
7066
|
-
|
|
7066
|
+
if (this.socket) {
|
|
7067
|
+
this.socket.close();
|
|
7068
|
+
this.socket = null;
|
|
7069
|
+
}
|
|
7067
7070
|
return new Promise((resolve, reject) => {
|
|
7071
|
+
this.socket = new WebSocket(this.url);
|
|
7068
7072
|
const timeout = setTimeout(() => {
|
|
7069
7073
|
reject(new Error("Connection timeout"));
|
|
7070
7074
|
this.socket?.close();
|