diff --git a/JS-SDK/bun.lockb b/JS-SDK/bun.lockb index d52b829..7294a72 100644 Binary files a/JS-SDK/bun.lockb and b/JS-SDK/bun.lockb differ diff --git a/JS-SDK/package.json b/JS-SDK/package.json index 0872401..f9120a2 100644 --- a/JS-SDK/package.json +++ b/JS-SDK/package.json @@ -1,6 +1,6 @@ { "name": "usetether", - "version": "1.1.7", + "version": "1.1.8", "author": "Braydon (Rainnny) ", "description": "An API designed to provide real-time access to a user's Discord data.", "keywords": [ @@ -28,7 +28,6 @@ "devDependencies": { "@types/bun": "latest", "@types/react": "^18.3.5", - "@types/react-dom": "^18.3.0", "react": "^18.3.1" }, "peerDependencies": { diff --git a/JS-SDK/src/hook/websocket.ts b/JS-SDK/src/hook/websocket.ts index 417bbba..bc3b376 100644 --- a/JS-SDK/src/hook/websocket.ts +++ b/JS-SDK/src/hook/websocket.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; import { Snowflake } from "@/types/snowflake"; import { TetherConfig } from "@/types/config"; import { DiscordUser } from "@/types/user"; -import { SocketPacket, UserStatusPacket } from "@/types/socket"; +import { UserStatusPacket } from "@/types/socket"; export const useTetherWS = ( snowflake: Snowflake, @@ -39,12 +39,12 @@ export const useTetherWS = ( socket.addEventListener("close", connect); // Reconnect on close socket.addEventListener("message", (event) => { - const packet: SocketPacket = JSON.parse( + const statusPacket: UserStatusPacket = JSON.parse( event.data - ) as SocketPacket; - if (packet.op === 1) { - setUser((packet as UserStatusPacket).user); - console.log("user status update", user); + ) as UserStatusPacket; + if (statusPacket.op === 1) { + setUser(statusPacket.user); + console.log("user status update", statusPacket.user); } }); }; diff --git a/JS-SDK/src/types/socket.ts b/JS-SDK/src/types/socket.ts index f289120..ad7fd20 100644 --- a/JS-SDK/src/types/socket.ts +++ b/JS-SDK/src/types/socket.ts @@ -1,6 +1,6 @@ import { DiscordUser } from "@/types/user"; -export type SocketPacket = { +type SocketPacket = { /** * The OP code for this packet. */