fix command recovery on start

This commit is contained in:
Andrei Vereha 2021-07-13 21:27:37 +02:00
parent bf81db0f6e
commit 21b78562e2

View file

@ -436,7 +436,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
override fun onStart() {
when (getCommandConfirmationFromState()) {
CommandConfirmationSuccess, CommandConfirmationDenied -> {
val now = System.currentTimeMillis()
val now = SystemClock.elapsedRealtime()
val newCommand = podState.activeCommand?.copy(
createdRealtime = now,
sentRealtime = now + 1
@ -446,7 +446,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
}
CommandSendingNotConfirmed -> {
val now = System.currentTimeMillis()
val now = SystemClock.elapsedRealtime()
val newCommand = podState.activeCommand?.copy(
createdRealtime = now,
sentRealtime = now + 1