Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-28 15:37:05 +03:00
parent e86de005bf
commit 74cf5ec26c
5 changed files with 19 additions and 4 deletions

View file

@ -89,6 +89,8 @@ class DerivationManagerImpl(
}
scope.launch {
val selectedWallet = appStateHolder.userWalletsListManager?.selectedUserWalletSync
val result = appStateHolder.tangemSdkManager?.derivePublicKeys(
scanResponse.card.cardId,
derivations,
@ -108,6 +110,14 @@ class DerivationManagerImpl(
val updatedScanResponse = scanResponse.copy(
derivedKeys = updatedDerivedKeys,
)
if (selectedWallet != null) {
val userWallet = selectedWallet.copy(
scanResponse = updatedScanResponse,
)
appStateHolder.userWalletsListManager?.save(userWallet, canOverride = true)
appStateHolder.walletStoresManager?.fetch(userWallet, true)
}
appStateHolder.mainStore?.dispatchOnMain(GlobalAction.SaveScanResponse(updatedScanResponse))
delay(DELAY_SDK_DIALOG_CLOSE)
onSuccess(updatedScanResponse)
@ -115,8 +125,7 @@ class DerivationManagerImpl(
is CompletionResult.Failure -> {
appStateHolder.mainStore?.dispatchDebugErrorNotification(
TapError.CustomError(
"Error adding " +
"tokens",
"Error derivation",
),
)
}