diff --git a/src/Scheduler.ts b/src/Scheduler.ts index 951f4d1..b00f802 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -199,7 +199,7 @@ function calculateInsertTime(tasks: ImmutableTaskList, name: string, args: Args, if (villageId && !insertedTs) { for (let taskTypePred of TASK_TYPE_PREDICATES) { - const sameVillageAndTypePred = t => sameVillage(villageId, t.args) && taskTypePred(t.name); + const sameVillageAndTypePred = t => sameVillage(villageId, t.args) && taskTypePred(name); insertedTs = lastTaskTime(tasks, sameVillageAndTypePred); if (insertedTs) { insertedTs += 1;