From 57877a8d1095b2ec6680300b85b79dee462b4a2c Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 14 Nov 2025 21:34:46 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../hotwallet/upgradewallet/UpgradeWalletModel.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/UpgradeWalletModel.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/UpgradeWalletModel.kt index 45ff3cb825..c030460551 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/UpgradeWalletModel.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/UpgradeWalletModel.kt @@ -101,7 +101,16 @@ internal class UpgradeWalletModel @Inject constructor( .doOnSuccess { // Check if user attempted to upgrade before but something went wrong and a full reset is required val userWallet = coldUserWalletBuilderFactory.create(it).build() - if (userWallet?.walletId == params.userWalletId && BackupValidator.isValidFull(it.card).not()) { + val sameWalletButNotFinishedBackup by lazy { + userWallet?.walletId == params.userWalletId && + BackupValidator.isValidFull(it.card).not() + } + val otherWalletAndAlreadyCreated by lazy { + userWallet?.walletId != params.userWalletId && + it.card.wallets.map { it.curve }.toSet().isNotEmpty() + } + + if (userWallet != null && (sameWalletButNotFinishedBackup || otherWalletAndAlreadyCreated)) { startResetCardsFlow.emit(userWallet) return@doOnSuccess }