We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fd565c commit 47cb185Copy full SHA for 47cb185
1 file changed
src/features/chat/hooks/chat-room-ws.ts
@@ -418,9 +418,14 @@ export function useChatRoomSocket(
418
destination: API_ENDPOINTS.wsLeaveChatRoom,
419
body: JSON.stringify({ chatRoomId: Number(chatRoomId) }),
420
});
421
- }
422
423
- client.deactivate();
+ // 메시지가 실제로 전송될 시간을 확보하기 위해 약간의 지연 후 연결 해제
+ setTimeout(() => {
424
+ client.deactivate();
425
+ }, 200);
426
+ } else {
427
428
+ }
429
clientRef.current = null;
430
};
431
}, [
0 commit comments