Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-01 12:48:45 +04:00
parent 0029b514bd
commit 3524a3bd86
7 changed files with 66 additions and 13 deletions

View file

@ -60,7 +60,7 @@ internal interface WalletWarningsClickIntents {
fun onCloseAlreadySignedHashesWarningClick()
fun onGenerateMissedAddressesClick(missedAddressCurrencies: List<CryptoCurrency>)
fun onGenerateMissedAddressesClick(userWalletId: UserWalletId, missedAddressCurrencies: List<CryptoCurrency>)
fun onOpenUnlockWalletsBottomSheetClick()
@ -164,19 +164,20 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
}
}
override fun onGenerateMissedAddressesClick(missedAddressCurrencies: List<CryptoCurrency>) {
override fun onGenerateMissedAddressesClick(
userWalletId: UserWalletId,
missedAddressCurrencies: List<CryptoCurrency>,
) {
analyticsEventHandler.send(MainScreen.NoticeScanYourCardTapped())
modelScope.launch {
val userWallet = getSelectedUserWallet() ?: return@launch
derivePublicKeysUseCase(
userWalletId = userWallet.walletId,
userWalletId = userWalletId,
currencies = missedAddressCurrencies,
).fold(
ifLeft = { TangemLogger.e("Failed to derive public keys", it) },
ifRight = {
fetchCryptoCurrencies(userWalletId = userWallet.walletId, currencies = missedAddressCurrencies)
fetchCryptoCurrencies(userWalletId = userWalletId, currencies = missedAddressCurrencies)
},
)
}

View file

@ -336,7 +336,10 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
tangemIcon = walletInterationIcon(userWallet),
missingAddressesCount = currencies.count(),
onGenerateClick = {
clickIntents.onGenerateMissedAddressesClick(missedAddressCurrencies = currencies)
clickIntents.onGenerateMissedAddressesClick(
userWalletId = userWallet.walletId,
missedAddressCurrencies = currencies,
)
},
),
condition = currencies.isNotEmpty(),

View file

@ -215,7 +215,10 @@ internal class GetWalletNotificationsFactory @Inject constructor(
tangemIcon = walletInterationIcon(userWallet),
missingAddressesCount = currencies.count(),
onGenerateClick = {
clickIntents.onGenerateMissedAddressesClick(missedAddressCurrencies = currencies)
clickIntents.onGenerateMissedAddressesClick(
userWalletId = userWallet.walletId,
missedAddressCurrencies = currencies,
)
},
),
condition = currencies.isNotEmpty(),