From 2cf43ca2103019906ac12dae626e4af7383485f9 Mon Sep 17 00:00:00 2001 From: Lee sang Yeop <mma7710@naver.com> Date: Tue, 10 Oct 2023 12:49:05 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=8B=A4=EC=9D=8C=20=EB=9D=BC=EC=9A=B4?= =?UTF-8?q?=EB=93=9C=20=EC=8B=9C=EC=9E=91=20=EC=8B=9C=20=EC=A4=80=EB=B9=84?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=EC=9D=B4=20=EB=B9=84=ED=99=9C=EC=84=B1?= =?UTF-8?q?=ED=99=94=20=EB=90=98=EC=96=B4=EC=9E=88=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RoundCheckIn/CheckInPage.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/RoundCheckIn/CheckInPage.tsx b/src/components/RoundCheckIn/CheckInPage.tsx index 1aa189b..deb4394 100644 --- a/src/components/RoundCheckIn/CheckInPage.tsx +++ b/src/components/RoundCheckIn/CheckInPage.tsx @@ -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]); @@ -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}>