Skip to content

Commit

Permalink
fix: 모바일에서 빠른 속도로 스크롤을 내릴 때 단어가 중복 로딩되는 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
3ae3ae committed Apr 15, 2024
1 parent e714b7c commit 1ed7bbe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $searchButton.addEventListener("click", async () => {

window.addEventListener("scroll", async () => {
if (canScrolling) {
canScrolling = false;
let fullHeight = document.documentElement.scrollHeight;
let myHeight =
document.documentElement.scrollTop +
Expand All @@ -51,5 +52,6 @@ window.addEventListener("scroll", async () => {
page = await getAndAddWordCards(page);
}
}
canScrolling = true;
}
});

0 comments on commit 1ed7bbe

Please sign in to comment.