From d1ecba3a2c1f04951e76b3a9e2309a07dc3ac27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=84=EC=A7=84=ED=98=B8?= Date: Thu, 7 Mar 2024 21:13:29 +0900 Subject: [PATCH] feat: call onVote when not selected only --- src/components/A/ATopicCard.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/A/ATopicCard.tsx b/src/components/A/ATopicCard.tsx index 088a903..068043a 100644 --- a/src/components/A/ATopicCard.tsx +++ b/src/components/A/ATopicCard.tsx @@ -41,7 +41,9 @@ const AlphaTopicCard = React.memo(({ topic, onVote, isTrending, isMine }: AlphaT }; const handleVote = (side: 'CHOICE_A' | 'CHOICE_B') => { - onVote(topic.topicId, side); + if (topic.selectedOption === null) { + onVote(topic.topicId, side); + } }; const handleOptionClick = () => {};