diff --git a/src/components/common/BackToTop.tsx b/src/components/common/BackToTop.tsx index b695084..6aa20fa 100644 --- a/src/components/common/BackToTop.tsx +++ b/src/components/common/BackToTop.tsx @@ -9,7 +9,7 @@ const BackToTop = () => { const handleScroll = () => { const scroll = window.scrollY; const height = document.documentElement.scrollHeight - window.innerHeight; - const progressValue = 307.919 - (scroll * 307.919 / height); + const progressValue = height > 0 ? (307.919 - (scroll * 307.919 / height)) : 307.919; setProgress(progressValue);