Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/pages/Chatroom.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ export default function Chatroom() {
const subscription = stompClient.subscribe(
`/topic/chat/${actualRoomId}`, (message) => {
const newMessage = JSON.parse(message.body);
console.log("서버에서 받은 메세지 = ",newMessage.toString())

// 사용자 이름 결정 (formatMessage와 동일한 로직 사용)
let userName = '시스템';
Expand Down Expand Up @@ -563,12 +564,12 @@ export default function Chatroom() {

const messageData = {
roomId: actualRoomId,
content: message.trim()
content: message.trim(),
};

try {
stompClientRef.current.publish({
destination: `/app/chat/${actualRoomId}/send`,
destination: `/app/chat/send`,
body: JSON.stringify(messageData)
});
setMessage('');
Expand Down