Updated on 2026-08-14

This commit is contained in:
Tangem 2021-11-10 17:03:48 +03:00
parent bdf9e2c891
commit c36ac2efa3
2 changed files with 8 additions and 13 deletions

View file

@ -43,20 +43,14 @@ fun globalReducer(action: Action, state: AppState): GlobalState {
}
is GlobalAction.SetWarningManager -> globalState.copy(warningManager = action.warningManager)
is GlobalAction.UpdateWalletSignedHashes -> {
val wallet = globalState.scanResponse?.card
?.wallet(action.walletPublicKey)
?.copy(
totalSignedHashes = action.walletSignedHashes,
remainingSignatures = action.remainingSignatures
)
val card = globalState.scanResponse?.card
wallet?.let { globalState.scanResponse.card.updateWallet(wallet) }
val card = globalState.scanResponse?.card ?: return globalState
val wallet = card.wallet(action.walletPublicKey) ?: return globalState
if (card != null) {
globalState.copy(scanResponse = globalState.scanResponse.copy(card = card))
} else {
globalState
}
val newCardInstance = card.updateWallet(wallet.copy(
totalSignedHashes = action.walletSignedHashes,
remainingSignatures = action.remainingSignatures
))
globalState.copy(scanResponse = globalState.scanResponse.copy(card = newCardInstance))
}
is GlobalAction.SetFeedbackManager -> {
globalState.copy(feedbackManager = action.feedbackManager)

View file

@ -125,6 +125,7 @@ class TangemSdkManager(private val tangemSdk: TangemSdk, private val context: Co
companion object {
val config = Config(
linkedTerminal = true,
allowUntrustedCards = true,
filter = CardFilter(
allowedCardTypes = FirmwareVersion.FirmwareType.values().toList()