Skip to content

Commit

Permalink
Merge pull request #121 from codesquad-members-2023/release-fe
Browse files Browse the repository at this point in the history
Release fe
  • Loading branch information
CDBchan authored Nov 3, 2023
2 parents 73361e8 + 1f514dc commit 46f7213
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fe/src/routes/js/ChatDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function ChatDetailPage() {
// api 를 부르는게 아니며, 랜더링될때 실행될 이유가 없어 useCallback을 사용한다.
const onMessageReceived = useCallback((data) => {
setMessages((prevMessages) => [...prevMessages, data.messages]);
setInputMessage("");
}, []);

// STOMP 클라이언트 사용
Expand Down Expand Up @@ -96,13 +95,17 @@ function ChatDetailPage() {
if (e.key === "Enter" && !e.shiftKey && !isComposing) {
e.preventDefault();
sendMessage(inputMessage, memberId);
setInputMessage("");
}
}}
/>
<button
type="button" // 버튼이 폼을 제출하지 않도록 설정
className={styles.sendButton}
onClick={() => sendMessage(inputMessage, memberId)}
onClick={() => {
sendMessage(inputMessage, memberId);
setInputMessage("");
}}
>
<img
alt="Send"
Expand Down

0 comments on commit 46f7213

Please sign in to comment.