Skip to content

Commit

Permalink
Merge pull request #144 from DDD-Community/feat/#133-hotfix
Browse files Browse the repository at this point in the history
feat: 응원하기 카운트가 적절하게 보이도록 수정
  • Loading branch information
G-hoon authored Jan 21, 2025
2 parents 07889ae + 4320841 commit 5347697
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Posture/PostrueCrew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ export default function PostrueCrew(props: PostureCrewProps): ReactElement {
const { myGroupData, isLoading } = useMyGroup()
const navigate = useNavigate()
const [cheeredUpCrewList, setCheeredUpCrewList] = useState<number[]>([])
const [myCheerCount, setMyCheerCount] = useState(0)

useEffect(() => {
const today = dayjs().format("YYYY-MM-DD")
getMyCheerUpInfo(today).then(({ data }) => {
setCheeredUpCrewList(data.cheeredUpUids)
setMyCheerCount(data.countCheeredUp)
})
}, [])

Expand Down Expand Up @@ -235,6 +237,7 @@ export default function PostrueCrew(props: PostureCrewProps): ReactElement {
const today = dayjs().format("YYYY-MM-DD")
getMyCheerUpInfo(today).then(({ data }) => {
setCheeredUpCrewList(data.cheeredUpUids)
setMyCheerCount(data.countCheeredUp)
})
}
})
Expand Down Expand Up @@ -301,7 +304,7 @@ export default function PostrueCrew(props: PostureCrewProps): ReactElement {
rank={crewMyInfo.myInfo.rank}
nickname={crewMyInfo.myInfo.nickname}
score={crewMyInfo.myInfo.score}
isMyCheerCount={crewMyInfo.countCheeredUp}
isMyCheerCount={myCheerCount}
isMe
/>
)}
Expand Down

0 comments on commit 5347697

Please sign in to comment.