From 1a23bd857644336002c305c411a53331225c8bd5 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 24 Sep 2025 12:54:57 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../walletbackup/model/WalletBackupModel.kt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/walletbackup/model/WalletBackupModel.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/walletbackup/model/WalletBackupModel.kt index b399977f24..19bc899913 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/walletbackup/model/WalletBackupModel.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/walletbackup/model/WalletBackupModel.kt @@ -24,7 +24,7 @@ import javax.inject.Inject @ModelScoped internal class WalletBackupModel @Inject constructor( paramsContainer: ParamsContainer, - private val getWalletUseCase: GetUserWalletUseCase, + private val getUserWalletUseCase: GetUserWalletUseCase, private val unlockHotWalletContextualUseCase: UnlockHotWalletContextualUseCase, override val dispatchers: CoroutineDispatcherProvider, private val router: Router, @@ -53,15 +53,17 @@ internal class WalletBackupModel @Inject constructor( ) init { - getWalletUseCase.invoke(params.userWalletId) - .fold( - ifLeft = { - Timber.e("Error on getting user wallet: $it") - }, - ifRight = { - updateBackupStatuses(it) - }, - ) + getUserWalletUseCase.invokeFlow(params.userWalletId) + .onEach { either -> + either.fold( + ifLeft = { + Timber.e("Error on getting user wallet: $it") + }, + ifRight = { + updateBackupStatuses(it) + }, + ) + }.launchIn(modelScope) } private fun updateBackupStatuses(userWallet: UserWallet) { @@ -95,7 +97,7 @@ internal class WalletBackupModel @Inject constructor( private fun onRecoveryPhraseClick() { if (uiState.value.backedUp) { - getWalletUseCase.invoke(params.userWalletId) + getUserWalletUseCase.invoke(params.userWalletId) .fold( ifLeft = { Timber.e("Error on getting user wallet: $it")