Fix task insertion
This commit is contained in:
parent
08d50921cf
commit
d350603c48
@ -257,7 +257,7 @@ function calculateInsertTime(tasks: ImmutableTaskList, name: string, args: Args,
|
|||||||
if (villageId && !insertedTs) {
|
if (villageId && !insertedTs) {
|
||||||
for (let taskTypePred of TASK_TYPE_PREDICATES) {
|
for (let taskTypePred of TASK_TYPE_PREDICATES) {
|
||||||
const sameVillageAndTypePred = (t: Task) =>
|
const sameVillageAndTypePred = (t: Task) =>
|
||||||
taskTypePred(name) && t.args.villageId === villageId && t.name === name;
|
taskTypePred(name) && taskTypePred(t.name) && sameVillage(villageId, t.args);
|
||||||
insertedTs = lastTaskTime(tasks, sameVillageAndTypePred);
|
insertedTs = lastTaskTime(tasks, sameVillageAndTypePred);
|
||||||
if (insertedTs) {
|
if (insertedTs) {
|
||||||
insertedTs += 1;
|
insertedTs += 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user