Skip to content

Commit

Permalink
Disable back callback in home presenter by default
Browse files Browse the repository at this point in the history
This is prevent the home screen to hijack the back clicks when it's first created. That's causing the back action to not work to close the app.
  • Loading branch information
msasikanth committed May 14, 2024
1 parent 0c9baa2 commit 3ff2f90
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ class HomePresenter(
internal val effects = presenterInstance.effects.asSharedFlow()

init {
lifecycle.doOnCreate { backHandler.register(backCallback) }
lifecycle.doOnCreate {
backHandler.register(backCallback)
backCallback.isEnabled = false
}
}

fun dispatch(event: HomeEvent) {
Expand Down

0 comments on commit 3ff2f90

Please sign in to comment.