Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kj9470 committed Nov 23, 2024
1 parent ab34630 commit 70c3e6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Router = () => {
<Route path='mypage' element={<MyPage />} />
<Route path='index' element={<Index />} />
<Route path='signup' element={<SignUp />} />
<Route path='/chat/room/:roomId' element={<ChattingPage />} />
<Route path='/chatting/example' element={<ChattingPage />} />
<Route path='chatting/book' element={<Book />} />
<Route path='voice-call' element={<VoiceCall />} />
<Route path='profile' element={<ProfilePage />} />
Expand Down
2 changes: 1 addition & 1 deletion src/page/main/chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Chat = () => {

const handleCardClick = (roomId: string) => {
console.log(`Room ID clicked: ${roomId}`);
navigate(`/chat/room/${roomId}`);
navigate(`/chatting/example`);
};

return (
Expand Down
6 changes: 3 additions & 3 deletions src/page/main/chat/chatting/ChattingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const ChattingPage = () => {
const [showCallButton, setShowCallButton] = useState(true);
const navigate = useNavigate();
let userId = 0;
const { roomId } = useParams<{ roomId: string }>();

const handleUserInfo = async () => {
try {
Expand All @@ -46,15 +45,16 @@ const ChattingPage = () => {
// Socket 연결
useEffect(() => {
const socket = io(signalUri, {
query: { roomId: roomId },
query: { roomId: 1 },
withCredentials: true,
});
socketRef.current = socket;

console.log('asdf');
// 메시지 수신 처리
socket.on('message', (data) => {
const isUserMessage = data.senderId === userId;
const nowTime = new Date();
console.log(data);
const formattedMessage: MessageData = {
text: data.content,
sender: isUserMessage ? 'user' : 'other',
Expand Down

0 comments on commit 70c3e6e

Please sign in to comment.