fix clash comming from RS history

This commit is contained in:
Milos Kozak 2020-07-01 20:54:49 +02:00
parent d66d362aa3
commit a08c1d5269
2 changed files with 4 additions and 2 deletions

View file

@ -308,6 +308,9 @@ public class TreatmentService extends OrmLiteBaseService<DatabaseHelper> {
//preserve carbs
if (existingTreatment.isValid && existingTreatment.carbs > 0 && treatment.carbs == 0) {
treatment.carbs = existingTreatment.carbs;
// preserve insulin
} else if (existingTreatment.isValid && existingTreatment.insulin > 0 && treatment.insulin == 0) {
treatment.insulin = existingTreatment.insulin;
}
getDao().delete(existingTreatment); // need to delete/create because date may change too

View file

@ -58,8 +58,7 @@ class DanaRSPlugin @Inject constructor(
private val danaPump: DanaPump,
private val detailedBolusInfoStorage: DetailedBolusInfoStorage,
private val fabricPrivacy: FabricPrivacy,
private val dateUtil: DateUtil,
private val config: ConfigInterface
private val dateUtil: DateUtil
) : PumpPluginBase(PluginDescription()
.mainType(PluginType.PUMP)
.fragmentClass(info.nightscout.androidaps.dana.DanaFragment::class.java.name)