Skip to content

Commit

Permalink
Merge pull request #104 from Easy-Ti-cket/fix/yes24focus
Browse files Browse the repository at this point in the history
Fix : 서버에서 몇 사이트 기록이 focus되지 않는 문제
  • Loading branch information
abyss-s authored Sep 20, 2024
2 parents b2ad5f7 + f80ec92 commit 91c4f8d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/challengeMode/record/Record.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -178,7 +182,7 @@ const Record = () => {
/>
</RecordContents>
<ButtonContainer>
<Button text="도전하기" onClick={() => nav("/select-site")} />
<Button text="다시 도전하기" onClick={() => nav("/select-site")} />
<Button
text="메인으로 돌아가기"
onClick={() => nav("/")}
Expand Down

0 comments on commit 91c4f8d

Please sign in to comment.