From c52d2e8ff8820f5fa0ce85c3cd6ac56775cce190 Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Fri, 11 Aug 2023 20:47:53 +0800 Subject: [PATCH] updated taskList.js --- scripts/taskList.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/taskList.js b/scripts/taskList.js index f8087a2..13c0a92 100644 --- a/scripts/taskList.js +++ b/scripts/taskList.js @@ -210,7 +210,7 @@ function addTask(username, userColor, task) { tasks[username].todos.push({ text: t, done: false }); } localStorage.setItem(`tasks`, JSON.stringify(tasks)); - renderTaskListToDOM(); + checkToAnimate(); return { task: tasksToAdd.join('", "'), tasksFailedToAdd: tasksFailedToAdd.join('", "') || "", @@ -219,7 +219,7 @@ function addTask(username, userColor, task) { tasks[username].todos.push({ text: task, done: false }); localStorage.setItem(`tasks`, JSON.stringify(tasks)); - renderTaskListToDOM(); + checkToAnimate(); return { task: task, @@ -565,7 +565,6 @@ function clearUserTasks(username) { tasks[username].todos = []; localStorage.setItem(`tasks`, JSON.stringify(tasks)); - renderTaskListToDOM(); } function clearAllDoneTasks() { @@ -609,11 +608,6 @@ function clearAllExceptStreamer(streamer) { } function renderTaskListToDOM() { - if (scrolling) { - checkToAnimate(); - return; - } - const tasks = JSON.parse(localStorage.tasks); const taskContainers = document.querySelectorAll(".task-container"); @@ -776,7 +770,8 @@ function cancelAnimation() { } (function () { - setupDB(); + resetDB(); + tests1(); importStyles(); renderTaskListToDOM(); })();