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 CommandConfirmed(val historyId: String, success: Boolean) : PodEvent()
data class CommandDenied(val historyId: String) : PodEvent()
} }

View file

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