From d6a1852cc6813d9ae47207e37262f8ea9589f270 Mon Sep 17 00:00:00 2001 From: rodvar Date: Mon, 16 Dec 2024 15:19:40 +1100 Subject: [PATCH] - fix main presenter onAttachView being called twice + logs and comments (#119) --- .../ui/uicases/offers/TakeOfferReviewTradeScreen.kt | 2 ++ .../network/bisq/mobile/presentation/BasePresenter.kt | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/TakeOfferReviewTradeScreen.kt b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/TakeOfferReviewTradeScreen.kt index 0c851386..a1358407 100644 --- a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/TakeOfferReviewTradeScreen.kt +++ b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/TakeOfferReviewTradeScreen.kt @@ -17,6 +17,8 @@ import org.koin.core.qualifier.named @Composable fun TakeOfferReviewTradeScreen() { + // TODO presenter for this? And call RememberLifecycle... + val navController: NavHostController = koinInject(named("RootNavController")) TakeOfferScaffold { Column(modifier = Modifier.padding(horizontal = 32.dp, vertical = 24.dp)) { diff --git a/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/BasePresenter.kt b/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/BasePresenter.kt index 8cf89b4f..1be5d137 100644 --- a/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/BasePresenter.kt +++ b/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/BasePresenter.kt @@ -65,7 +65,9 @@ abstract class BasePresenter(private val rootPresenter: MainPresenter?): ViewPre } @CallSuper - override fun onViewAttached() { } + override fun onViewAttached() { + log.i { "Lifecycle: View attached to presenter" } + } @CallSuper override fun onViewUnattaching() { } @@ -116,8 +118,7 @@ abstract class BasePresenter(private val rootPresenter: MainPresenter?): ViewPre // at the moment the attach view is with the activity/ main view in ios // unless we change this there is no point in sharing with dependents this.view = view - log.i { "Lifecycle: View Attached to Presenter" } - onViewAttached() + log.i { "Lifecycle: Main View attached to Main Presenter" } } fun detachView() {