fixed rendering issues, undone task count
This commit is contained in:
parent
3c86c9ccc5
commit
e264073c29
1 changed files with 9 additions and 1 deletions
|
|
@ -530,6 +530,10 @@ function unfocusTask(username) {
|
||||||
|
|
||||||
localStorage.setItem(`tasks`, JSON.stringify(tasks));
|
localStorage.setItem(`tasks`, JSON.stringify(tasks));
|
||||||
|
|
||||||
|
if (!scrolling) {
|
||||||
|
renderTaskListToDOM();
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
};
|
};
|
||||||
|
|
@ -998,11 +1002,13 @@ function markTaskUndone(username, task) {
|
||||||
index = parseInt(t) - 1; // ACTUAL INDEX
|
index = parseInt(t) - 1; // ACTUAL INDEX
|
||||||
} else {
|
} else {
|
||||||
tasksFailedToMarkUndone.push(t);
|
tasksFailedToMarkUndone.push(t);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index < 0 || index > tasks[username].todos.length - 1) {
|
if (index < 0 || index > tasks[username].todos.length - 1) {
|
||||||
tasksFailedToMarkUndone.push(t);
|
tasksFailedToMarkUndone.push(t);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
tasksMarkedUndone.push(
|
tasksMarkedUndone.push(
|
||||||
|
|
@ -1011,8 +1017,8 @@ function markTaskUndone(username, task) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tasksMarkedUndone.push(tasks[username].todos[index].text);
|
tasksMarkedUndone.push(tasks[username].todos[index].text);
|
||||||
addDoneCount(username, -1);
|
|
||||||
}
|
}
|
||||||
|
addDoneCount(username, -1);
|
||||||
tasks[username].todos[index].done = false;
|
tasks[username].todos[index].done = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1069,6 +1075,7 @@ function markTaskUndone(username, task) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks[username].todos[index].done = false;
|
tasks[username].todos[index].done = false;
|
||||||
|
addDoneCount(username, -1);
|
||||||
|
|
||||||
localStorage.setItem(`tasks`, JSON.stringify(tasks));
|
localStorage.setItem(`tasks`, JSON.stringify(tasks));
|
||||||
|
|
||||||
|
|
@ -1084,6 +1091,7 @@ function markTaskUndone(username, task) {
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
tasks[username].todos[index].done = false;
|
tasks[username].todos[index].done = false;
|
||||||
|
addDoneCount(username, -1);
|
||||||
|
|
||||||
localStorage.setItem(`tasks`, JSON.stringify(tasks));
|
localStorage.setItem(`tasks`, JSON.stringify(tasks));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue