diff --git a/src/lib/hooks/handlers/useHandleRoom.ts b/src/lib/hooks/handlers/useHandleRoom.ts index 31b83e1..e06788b 100644 --- a/src/lib/hooks/handlers/useHandleRoom.ts +++ b/src/lib/hooks/handlers/useHandleRoom.ts @@ -64,7 +64,7 @@ const useHandleRoom = () => { status: 'success', }); queryClient.invalidateQueries({ queryKey: QUERY_KEYS.ROOMS }); - // navigate(`/chat/channels/${}/${}`) + navigate(`/chat/main`); }, onError: (error) => { console.error('Error deleting room:', error); @@ -85,6 +85,7 @@ const useHandleRoom = () => { status: 'success', }); queryClient.invalidateQueries({ queryKey: QUERY_KEYS.ROOMS }); + navigate(`/chat/main`); }, onError: (error) => { console.error('Error leaving room:', error); diff --git a/src/pages/FriendPage.tsx b/src/pages/FriendPage.tsx index 798e117..7a810e1 100644 --- a/src/pages/FriendPage.tsx +++ b/src/pages/FriendPage.tsx @@ -3,6 +3,7 @@ import useDmStore from '@/lib/stores/useDmStore'; import { Box } from '@chakra-ui/react'; import { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; +import useRoomStore from '@/lib/stores/useRoomStore'; import FriendList from '../components/friend/FriendList'; import FriendRequest from '../components/friend/FriendRequest'; import FriendTopMenu from '../components/friend/FriendTopMenu'; @@ -17,6 +18,11 @@ const FriendPage = ({ const roomIdParam = param.id ? parseInt(param.id, 10) : 0; const { setCurrentDmId, dmRooms, setCurrentDmRoom } = useDmStore(); + const { setCurrentChannelPath } = useRoomStore(); + + useEffect(() => { + setCurrentChannelPath({ roomId: 0, categoryId: 0, channelId: 0 }); + }, []); useEffect(() => { setCurrentDmId(roomIdParam);