merge CommandConfirmed and CommandDenied

This commit is contained in:
Andrei Vereha 2021-05-01 19:19:18 +02:00
parent ee73cd5f2b
commit 9e770601f3
2 changed files with 3 additions and 5 deletions

View file

@ -66,7 +66,5 @@ sealed class PodEvent {
}
}
data class CommandConfirmed(val historyId: String) : PodEvent()
data class CommandDenied(val historyId: String) : PodEvent()
data class CommandConfirmed(val historyId: String, success: Boolean) : PodEvent()
}

View file

@ -224,9 +224,9 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
else {
podState.activeCommand = null
if (sequenceNumberOfLastProgrammingCommand == sequence)
source.onSuccess(PodEvent.CommandConfirmed(historyId))
source.onSuccess(PodEvent.CommandConfirmed(historyId, true))
else
source.onSuccess(PodEvent.CommandDenied(historyId))
source.onSuccess(PodEvent.CommandConfirmed(historyId, false))
}
}
?: source.onComplete() // no active programming command