Minor improvement
This commit is contained in:
parent
d08a979da3
commit
7e5667705d
1 changed files with 4 additions and 3 deletions
|
@ -25,11 +25,12 @@ class OmnipodDashManagerImpl @Inject constructor(
|
||||||
) : OmnipodDashManager {
|
) : OmnipodDashManager {
|
||||||
|
|
||||||
private val observePodReadyForActivationPart1: Observable<PodEvent>
|
private val observePodReadyForActivationPart1: Observable<PodEvent>
|
||||||
get() {
|
get() = Observable.defer {
|
||||||
if (podStateManager.activationProgress.isBefore(ActivationProgress.PHASE_1_COMPLETED)) {
|
if (podStateManager.activationProgress.isBefore(ActivationProgress.PHASE_1_COMPLETED)) {
|
||||||
return Observable.empty()
|
Observable.empty()
|
||||||
|
} else {
|
||||||
|
Observable.error(IllegalStateException("Pod is in an incorrect state"))
|
||||||
}
|
}
|
||||||
return Observable.error(IllegalStateException("Pod is in an incorrect state"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun activatePodPart1(): Observable<PodEvent> {
|
override fun activatePodPart1(): Observable<PodEvent> {
|
||||||
|
|
Loading…
Reference in a new issue