NSCv3: fix extended bolus sync

This commit is contained in:
Milos Kozak 2023-10-21 12:24:35 +02:00
parent 24bdf92270
commit 17c3ef6274
2 changed files with 3 additions and 3 deletions

View file

@ -528,10 +528,10 @@ class DataSyncSelectorV3 @Inject constructor(
aapsLogger.info(LTag.NSCLIENT, "Ignoring ExtendedBolus. Only NS id changed ID: ${eb.second.id} ")
// without nsId = create new
eb.first.interfaceIDs.nightscoutId == null ->
cont = activePlugin.activeNsClient?.nsAdd("treatments", DataSyncSelector.PairExtendedBolus(eb.first, eb.second.id), "$startId/$lastDbId") ?: false
cont = activePlugin.activeNsClient?.nsAdd("treatments", DataSyncSelector.PairExtendedBolus(eb.first, eb.second.id), "$startId/$lastDbId", profile) ?: false
// with nsId = update
eb.first.interfaceIDs.nightscoutId != null ->
cont = activePlugin.activeNsClient?.nsUpdate("treatments", DataSyncSelector.PairExtendedBolus(eb.first, eb.second.id), "$startId/$lastDbId") ?: false
cont = activePlugin.activeNsClient?.nsUpdate("treatments", DataSyncSelector.PairExtendedBolus(eb.first, eb.second.id), "$startId/$lastDbId", profile) ?: false
}
} else aapsLogger.info(LTag.NSCLIENT, "Ignoring ExtendedBolus. No profile: ${eb.second.id} ")
if (cont) confirmLastExtendedBolusIdIfGreater(eb.second.id)

View file

@ -35,7 +35,7 @@ class TreatmentsActivity : TranslatedDaggerAppCompatActivity() {
// Use index, TabItems crashes with an id
val useFakeTempBasal = activePlugin.activePump.isFakingTempsByExtendedBoluses
binding.treatmentsTabs.getTabAt(1)?.view?.visibility = useFakeTempBasal.toVisibility()
binding.treatmentsTabs.getTabAt(1)?.view?.visibility = useFakeTempBasal.not().toVisibility()
setFragment(TreatmentsBolusCarbsFragment())
setSupportActionBar(binding.toolbar)