Only match uncompleted tasks
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
parent
6344344f86
commit
8fa530149f
1 changed files with 1 additions and 4 deletions
|
@ -59,15 +59,12 @@ function isTaskInList(task, listId, checkSubtasks = true) {
|
|||
* @returns {Boolean}
|
||||
*/
|
||||
function testTask(task, testFunction, checkSubtasks = false) {
|
||||
if (testFunction(task)) {
|
||||
if (!task.completed && testFunction(task)) {
|
||||
return true
|
||||
}
|
||||
if (checkSubtasks) {
|
||||
for (var key in task.subTasks) {
|
||||
var subTask = task.subTasks[key]
|
||||
if (testFunction(subTask)) {
|
||||
return true
|
||||
}
|
||||
if (testTask(subTask, testFunction, checkSubtasks)) {
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue