From 455d83543b829313cee95bde6431295b43cf08d5 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Mon, 9 Sep 2024 20:19:35 -0400 Subject: [PATCH] test --- JS-SDK/src/hook/websocket.ts | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/JS-SDK/src/hook/websocket.ts b/JS-SDK/src/hook/websocket.ts index 93d7660..c23d646 100644 --- a/JS-SDK/src/hook/websocket.ts +++ b/JS-SDK/src/hook/websocket.ts @@ -11,37 +11,9 @@ export const useTetherWS = ( ): Snowflake => { const [user] = useState(snowflake); - const url: string = `ws${secure && "s"}://${endpoint}/gateway`; useEffect(() => { - // Prevent from running on the server - if (typeof window === "undefined") { - return; - } - let socket: WebSocket; // The current WebSocket connection - - /** - * Establish a connection with the API. - */ - function connect() { - console.log("connecting to:", url); - socket = new WebSocket("wss://usetether.rest/gateway"); // Connect to the gateway - socket.addEventListener("open", () => - console.log("[Tether] WebSocket connection established!") - ); - // socket.addEventListener("close", connect); - // - // socket.addEventListener("message", (event) => { - // console.log("data:", event.data); - // }); - } - connect(); - - // Cleanup - return () => { - // socket.removeEventListener("close", connect); - socket.close(); - }; - }, [url]); + console.log("HELLO WORLD"); + }, [snowflake]); return user; };