Skip to content

Commit

Permalink
feat: re-implement reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
ynwd committed Nov 30, 2024
1 parent 9435773 commit 337ead4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/hook/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 337ead4

Please sign in to comment.