From 2a6aa3856380057c70b72ff97d25e12c0f0642b4 Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Mon, 21 Aug 2023 13:19:16 +0800 Subject: [PATCH] updated taskList.js --- scripts/taskList.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/taskList.js b/scripts/taskList.js index 08192d4..0c084c5 100644 --- a/scripts/taskList.js +++ b/scripts/taskList.js @@ -457,7 +457,9 @@ function markTaskDone(username, task) { task = tasks[username].todos[index].text; tasks[username].todos[index].done = true; localStorage.setItem(`tasks`, JSON.stringify(tasks)); - renderTaskListToDOM(); + if (!scrolling) { + renderTaskListToDOM(); + } return { markedTasks: task, failedTasks: "", @@ -548,7 +550,9 @@ function markTaskUndone(username, task) { tasks[username].todos[index].done = false; localStorage.setItem(`tasks`, JSON.stringify(tasks)); - renderTaskListToDOM(); + if (!scrolling) { + renderTaskListToDOM(); + } return { markedTasks: tasks[username].todos[index].text, failedTasks: "",