v1.0-230926 #27

Merged
FatttSnake merged 81 commits from dev into master 2023-09-26 11:06:08 +08:00
Showing only changes of commit e3ae52fb0e - Show all commits

View File

@@ -61,6 +61,9 @@ const Home: React.FC = () => {
}
const handleScrollUp = () => {
if (currentContent <= 0) {
return
}
handleScrollToContent(currentContent - 1)()
clearTimeout(scrollTimeout.current)
scrollTimeout.current = setTimeout(() => {
@@ -69,6 +72,9 @@ const Home: React.FC = () => {
}
const handleScrollDown = () => {
if (currentContent >= content.length) {
return
}
handleScrollToContent(currentContent + 1)()
clearTimeout(scrollTimeout.current)
scrollTimeout.current = setTimeout(() => {
@@ -82,14 +88,8 @@ const Home: React.FC = () => {
}
if (event.deltaY > 0) {
if (currentContent >= content.length) {
return
}
handleScrollDown()
} else {
if (currentContent <= 0) {
return
}
handleScrollUp()
}
}