From f339e3f2bb791283d421957b1246b82a31a4a9d1 Mon Sep 17 00:00:00 2001 From: hanheel Date: Wed, 18 Sep 2024 01:02:00 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=A1=9C=EB=94=A9=20=ED=83=80=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/challengeMode/record/Record.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/challengeMode/record/Record.jsx b/src/pages/challengeMode/record/Record.jsx index 5ad737b..a5c12d9 100644 --- a/src/pages/challengeMode/record/Record.jsx +++ b/src/pages/challengeMode/record/Record.jsx @@ -58,7 +58,7 @@ const Record = () => { //내 기록 index (순위x, 세션스토리지 / db 비교) useEffect(() => { if (myRecord && filteredRecords.length > 0) { - // console.log("데이터 비교함") + console.log("데이터 비교함"); const myRecordNanoSec = myRecord.timeStamp.nanoseconds; const myRecordSec = myRecord.timeStamp.seconds; setMyRecordIndex( @@ -90,7 +90,11 @@ const Record = () => { //activePage(활성화될 페이지) 설정 useEffect(() => { - if (myRecordIndex !== -1) { + if ( + myRecordIndex !== null && + filteredRecords.length > 0 && + records.length > 0 + ) { setActivePage( myRecordIndex ? Math.floor((myRecordIndex + 1) / 10) + 1 : 1 ); @@ -178,7 +182,7 @@ const Record = () => { /> -