diff --git a/front/src/pages/Main/MainBody.tsx b/front/src/pages/Main/MainBody.tsx index c29b00c..424b945 100644 --- a/front/src/pages/Main/MainBody.tsx +++ b/front/src/pages/Main/MainBody.tsx @@ -20,7 +20,10 @@ const MainBody = (): JSX.Element => { if (messageID === 0) { return; } - + const nowMsg = messageList.find(message => message.id === messageID); + if (nowMsg === undefined || nowMsg.opened !== null) { + return; + } axios .put(`/api/message/${messageID}/open`) .then(() => {