From eea0cae5ae404182087c86e161578127656d80b6 Mon Sep 17 00:00:00 2001 From: lim Date: Wed, 21 Feb 2024 15:31:19 +0900 Subject: [PATCH] [frontend] Rename socket event from leave to leave-room --- frontend/app/lib/client-socket-provider.tsx | 2 +- frontend/app/lib/hooks/useKick.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/lib/client-socket-provider.tsx b/frontend/app/lib/client-socket-provider.tsx index a2f36ff3..4c03fd2c 100644 --- a/frontend/app/lib/client-socket-provider.tsx +++ b/frontend/app/lib/client-socket-provider.tsx @@ -121,7 +121,7 @@ export default function SocketProvider() { } else if ( event === "delete-room" || event === "enter-room" || - event === "leave" || + event === "leave-room" || event === "mute" || event === "unmute" || event === "update-role" diff --git a/frontend/app/lib/hooks/useKick.ts b/frontend/app/lib/hooks/useKick.ts index 50f1375a..a6c5f0d5 100644 --- a/frontend/app/lib/hooks/useKick.ts +++ b/frontend/app/lib/hooks/useKick.ts @@ -40,9 +40,9 @@ export function useKick(roomId: number, userId: number, meId: number) { ); useEffect(() => { - socket.on("leave", handleLeaveRoomEvent); + socket.on("leave-room", handleLeaveRoomEvent); return () => { - socket.off("leave", handleLeaveRoomEvent); + socket.off("leave-room", handleLeaveRoomEvent); }; }, [handleLeaveRoomEvent]);