Skip to content

Commit

Permalink
Fix: 다음 라운드 시작 시 준비 버튼이 비활성화 되어있는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
pp449 committed Oct 10, 2023
1 parent 7b36f85 commit 2cf43ca
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/RoundCheckIn/CheckInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ const CheckInPage = ({
};

useEffect(() => {
if (ready) return;
const findUser = checkInUser.find((user) => requestUser === user);
if (findUser === undefined) return;
if (findUser === undefined) {
setReady(false);
return;
}

setReady(true);
}, [checkInUser]);

Expand All @@ -71,12 +74,14 @@ const CheckInPage = ({
<RemainTimeItem></RemainTimeItem>
</RemainTimeWrapper>
<ButtonWrapper>
{players.length !== 0 && players.length === checkInUser.length ? (
{players.length !== 0 && players.length <= checkInUser.length ? (
<>
<RankingSelect value={rank} onChange={handleRankingChange} disabled={isSendingRanking}>
<option value=''>경기 후 게임 결과를 입력해주세요</option>
{players.map((player, idx) => (
<option value={idx + 1}>{idx + 1}</option>
<option key={idx} value={idx + 1}>
{idx + 1}
</option>
))}
</RankingSelect>
<RankingSubmitButton disabled={isSendingRanking} onClick={onClickRankingButton}>
Expand Down

0 comments on commit 2cf43ca

Please sign in to comment.