profile: fix redundant EPS

This commit is contained in:
Milos Kozak 2023-05-14 09:57:48 +02:00
parent 01bb554651
commit 0dad5ca499

View file

@ -119,7 +119,7 @@ class CommandQueueImplementation @Inject constructor(
override fun run() {
if (!result.success) {
uiInteraction.runAlarm(result.comment, rh.gs(info.nightscout.core.ui.R.string.failed_update_basal_profile), info.nightscout.core.ui.R.raw.boluserror)
} else if (result.enacted || effective is ValueWrapper.Existing && effective.value.originalEnd < dateUtil.now()) {
} else if (result.enacted || effective is ValueWrapper.Existing && effective.value.originalEnd < dateUtil.now() && effective.value.originalDuration != 0L) {
val nonCustomized = ProfileSealed.PS(it).convertToNonCustomizedProfile(dateUtil)
EffectiveProfileSwitch(
timestamp = dateUtil.now(),