optimize query if TBR is not faked by EB
This commit is contained in:
parent
de842ce1ee
commit
29acc3d17f
1 changed files with 5 additions and 4 deletions
|
@ -510,10 +510,11 @@ class IobCobCalculatorPlugin @Inject constructor(
|
||||||
|
|
||||||
val tb = repository.getTemporaryBasalActiveAt(timestamp).blockingGet()
|
val tb = repository.getTemporaryBasalActiveAt(timestamp).blockingGet()
|
||||||
if (tb is ValueWrapper.Existing) return tb.value
|
if (tb is ValueWrapper.Existing) return tb.value
|
||||||
val eb = repository.getExtendedBolusActiveAt(timestamp).blockingGet()
|
if (activePlugin.activePump.isFakingTempsByExtendedBoluses) {
|
||||||
val profile = profileFunction.getProfile(timestamp) ?: return null
|
val eb = repository.getExtendedBolusActiveAt(timestamp).blockingGet()
|
||||||
if (eb is ValueWrapper.Existing && activePlugin.activePump.isFakingTempsByExtendedBoluses)
|
val profile = profileFunction.getProfile(timestamp) ?: return null
|
||||||
return eb.value.toTemporaryBasal(profile)
|
if (eb is ValueWrapper.Existing) return eb.value.toTemporaryBasal(profile)
|
||||||
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue