diff --git a/toolkit/event-observer/src/main/kotlin/br/com/arch/toolkit/result/ObserveWrapper.kt b/toolkit/event-observer/src/main/kotlin/br/com/arch/toolkit/result/ObserveWrapper.kt index 50a0dfb9..2a6b9665 100644 --- a/toolkit/event-observer/src/main/kotlin/br/com/arch/toolkit/result/ObserveWrapper.kt +++ b/toolkit/event-observer/src/main/kotlin/br/com/arch/toolkit/result/ObserveWrapper.kt @@ -1056,7 +1056,7 @@ class ObserveWrapper internal constructor() { val observer = object : Observer?> { override fun onChanged(value: DataResult?) { scope.launchWithErrorTreatment { - handleResult(value) { owner.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED) } + handleResult(value) { owner.lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED) } if (eventList.isEmpty()) { liveData.removeObserver(this) } @@ -1110,7 +1110,11 @@ class ObserveWrapper internal constructor() { // Handle Loading event is LoadingEvent -> event.run { - wrapper.handle(isLoading, transformDispatcher, evaluateBeforeDispatch) && isLoading.not() + wrapper.handle( + isLoading, + transformDispatcher, + evaluateBeforeDispatch + ) && isLoading.not() } // Handle ShowLoading @@ -1135,7 +1139,11 @@ class ObserveWrapper internal constructor() { // Handle Data event is DataEvent -> (event as DataEvent).wrapper.let { - it.handle(result.data, transformDispatcher, evaluateBeforeDispatch) && (result.data != null) + it.handle( + result.data, + transformDispatcher, + evaluateBeforeDispatch + ) && (result.data != null) } // Handle Empty