Skip to content

Commit

Permalink
Fix: 재투표 버튼, 데이터 처음에만 불러오기
Browse files Browse the repository at this point in the history
  • Loading branch information
goeun208 committed Apr 25, 2024
1 parent 4d7ff3f commit d809075
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/vote/detail/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const VoteDetailPage = () => {
console.log('response', response);
if (response.data?.message === '성공') setVoteData(response.data?.data);
console.log('vote data', voteData);
}, [response, voteData]);
}, []);

// 투표 종료일 포맷 변경
useEffect(() => {
Expand Down Expand Up @@ -128,7 +128,9 @@ const VoteDetailPage = () => {
</div>
{/* 투표 창 */}
<div className="w-[1168px] mx-auto">
<div className="w-[1168px] mx-auto cursor-pointer">
<div
className="w-[1168px] mx-auto cursor-pointer"
style={{ pointerEvents: voteData?.isVotingParticipant ? (clickedAgainBtn ? 'auto' : 'none') : 'auto' }}>
{voteData?.voteStatuses.map((item: VoteStatusData) => (
<VoteChoiceOption
key={item.bestPlaceId}
Expand Down

0 comments on commit d809075

Please sign in to comment.