preserve invalidated status for cgm data
This commit is contained in:
parent
3d94f3f840
commit
4c4122c6a6
1 changed files with 5 additions and 2 deletions
|
@ -27,11 +27,14 @@ class CgmSourceTransaction(
|
|||
noise = it.noise,
|
||||
trendArrow = it.trendArrow,
|
||||
sourceSensor = it.sourceSensor
|
||||
)
|
||||
glucoseValue.interfaceIDs.nightscoutId = it.nightscoutId
|
||||
).also { gv ->
|
||||
gv.interfaceIDs.nightscoutId = it.nightscoutId
|
||||
}
|
||||
// if nsId is not provided in new record, copy from current if exists
|
||||
if (glucoseValue.interfaceIDs.nightscoutId == null)
|
||||
current?.let { existing -> glucoseValue.interfaceIDs.nightscoutId = existing.interfaceIDs.nightscoutId }
|
||||
// preserve invalidated status (user may delete record in UI)
|
||||
current?.let { existing -> glucoseValue.isValid = existing.isValid }
|
||||
when {
|
||||
// new record, create new
|
||||
current == null -> {
|
||||
|
|
Loading…
Reference in a new issue