Skip to content

Commit 337ead4

Browse files
committed
feat: re-implement reconnect
1 parent 9435773 commit 337ead4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/hook/socket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const useWebSocket = (url: string, room: string, user: string) => {
5757
setIsConnected(false);
5858

5959
// Attempt to reconnect after a delay
60-
reconnectTimeoutRef.current = setTimeout(() => {
60+
reconnectTimeoutRef.current = setInterval(() => {
6161
connectWebSocket();
6262
}, 3000); // Reconnect after 3 seconds
6363
};

0 commit comments

Comments
 (0)