Only match uncompleted tasks

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Raimund Schlüßler 2019-11-02 21:00:19 +01:00
parent 6344344f86
commit 8fa530149f
No known key found for this signature in database
GPG key ID: 036FA7EB1A599178

View file

@ -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
}