From 3ff2f909d7eb736e05e6b9bfd4fa57d5c36dc675 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Tue, 14 May 2024 14:31:42 +0530 Subject: [PATCH] Disable back callback in home presenter by default 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. --- .../kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt index dd66b51d4..9c3a4f451 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt @@ -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) {