Update taskList.js

- fixed overlap issue
- fixed scrolling issue
This commit is contained in:
liyunze 2023-08-11 20:21:30 +08:00
parent ffc9a983d0
commit b0ad867e6b

View file

@ -609,6 +609,11 @@ function clearAllExceptStreamer(streamer) {
} }
function renderTaskListToDOM() { function renderTaskListToDOM() {
if (scrolling) {
checkToAnimate();
return;
}
const tasks = JSON.parse(localStorage.tasks); const tasks = JSON.parse(localStorage.tasks);
const taskContainers = document.querySelectorAll(".task-container"); const taskContainers = document.querySelectorAll(".task-container");
@ -751,9 +756,10 @@ async function checkToAnimate() {
await sleep(scrollingSpeed); await sleep(scrollingSpeed);
scrolling = false; scrolling = false;
renderTaskListToDOM();
checkToAnimate(); checkToAnimate();
} }
} else if (scrolling) { } else if (!scrolling) {
document.querySelector(".secondary").style.display = "none"; document.querySelector(".secondary").style.display = "none";
// cancel animations // cancel animations