From 2746ee308a7580db1b1cbd923ab136f539db6a5a Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 17 Nov 2025 10:47:22 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../wallet/child/wallet/model/WalletModel.kt | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt index 183f18f851..645f80eb62 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt @@ -117,7 +117,13 @@ internal class WalletModel @Inject constructor( init { analyticsEventsHandler.send(WalletScreenAnalyticsEvent.MainScreen.ScreenOpened) - suggestToEnableBiometrics() + screenLifecycleProvider.isBackgroundState + .onEach { isBackground -> + if (isBackground.not()) { + suggestToEnableBiometrics() + } + }.launchIn(modelScope) + suggestToOpenMarkets() maybeMigrateNames() @@ -162,15 +168,13 @@ internal class WalletModel @Inject constructor( walletScreenContentLoader.cancelAll() } - private fun suggestToEnableBiometrics() { - modelScope.launch(dispatchers.main) { - withContext(dispatchers.io) { delay(timeMillis = 1_800) } + private suspend fun suggestToEnableBiometrics() { + if (shouldShowAskBiometryBottomSheet()) { + delay(timeMillis = 1_800) - if (shouldShowAskBiometryBottomSheet()) { - innerWalletRouter.dialogNavigation.activate( - configuration = WalletDialogConfig.AskForBiometry, - ) - } + innerWalletRouter.dialogNavigation.activate( + configuration = WalletDialogConfig.AskForBiometry, + ) } }