diff --git a/app/src/main/java/com/tangem/tap/MainActivity.kt b/app/src/main/java/com/tangem/tap/MainActivity.kt index 0e5b92b3ea..fa76d52ce9 100644 --- a/app/src/main/java/com/tangem/tap/MainActivity.kt +++ b/app/src/main/java/com/tangem/tap/MainActivity.kt @@ -448,6 +448,9 @@ class MainActivity : AppCompatActivity(), SnackbarHandler, ActivityResultCallbac override fun onDestroy() { intentProcessor.removeAll() + // workaround: kill process when activity destroy to avoid state when lock() wallets + // and navigation to unlock screen was skipped because system kills activity but not process + android.os.Process.killProcess(android.os.Process.myPid()) super.onDestroy() } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt index 13f4eba101..68fe1de07a 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/viewmodels/TokenDetailsViewModel.kt @@ -139,7 +139,9 @@ internal class TokenDetailsViewModel @Inject constructor( ?.unbundle(CryptoCurrency.serializer()) ?: error("This screen can't be opened without `CryptoCurrency`") - private val userWallet: UserWallet + private val userWallet: UserWallet by lazy { + getUserWalletUseCase(userWalletId).getOrNull() ?: error("UserWallet not found") + } lateinit var router: InnerTokenDetailsRouter @@ -203,7 +205,6 @@ internal class TokenDetailsViewModel @Inject constructor( ), ), ) - userWallet = getUserWalletUseCase(userWalletId).getOrNull() ?: error("UserWallet not found") } private fun onBuyCurrencyDeepLink(externalTxId: String) {