From 337ead4a79a0e8def6a5c16b1034f4841ec4fbe8 Mon Sep 17 00:00:00 2001 From: ynwd <10122431+ynwd@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:48:11 +0700 Subject: [PATCH] feat: re-implement reconnect --- modules/hook/socket.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hook/socket.ts b/modules/hook/socket.ts index 253b38c0..cacfc9cb 100644 --- a/modules/hook/socket.ts +++ b/modules/hook/socket.ts @@ -57,7 +57,7 @@ const useWebSocket = (url: string, room: string, user: string) => { setIsConnected(false); // Attempt to reconnect after a delay - reconnectTimeoutRef.current = setTimeout(() => { + reconnectTimeoutRef.current = setInterval(() => { connectWebSocket(); }, 3000); // Reconnect after 3 seconds };