From 4b8395a3733f1ecd05a8c40c7d09a126f8d5d811 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Oct 2019 08:27:33 +0200 Subject: [PATCH] make objective reset not permanent --- .../constraints/objectives/objectives/Objective.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java index 2a4726f406..b126f93673 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java @@ -37,9 +37,9 @@ public abstract class Objective { this.gate = gate; startedOn = SP.getLong("Objectives_" + spName + "_started", 0L); accomplishedOn = SP.getLong("Objectives_" + spName + "_accomplished", 0L); - if ((accomplishedOn - DateUtil.now()) > T.days(1).msecs()) { // more than 1 day in the future - setStartedOn(0); - setAccomplishedOn(0); + if ((accomplishedOn - DateUtil.now()) > T.hours(3).msecs() || (startedOn - DateUtil.now()) > T.hours(3).msecs()) { // more than 3 hours in the future + startedOn = 0; + accomplishedOn = 0; } setupTasks(tasks); for (Task task : tasks) task.objective = this;