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; };