Updated on 2026-08-14

This commit is contained in:
Tangem 2021-10-22 12:19:51 +03:00
parent e160648fe2
commit 0acf130492
4 changed files with 11 additions and 16 deletions

View file

@ -6,6 +6,7 @@ import com.tangem.common.KeyPair
import com.tangem.common.card.EllipticCurve
import com.tangem.common.core.CardSession
import com.tangem.common.core.CardSessionRunnable
import com.tangem.common.core.TangemSdkError
import com.tangem.common.extensions.hexToBytes
import com.tangem.operations.wallet.CreateWalletCommand
import com.tangem.operations.wallet.CreateWalletResponse

View file

@ -64,7 +64,6 @@ private fun handlePrepareScreen(action: DetailsAction.PrepareScreen, state: Deta
appCurrencyState = AppCurrencyState(
action.fiatCurrencyName
),
securityScreenState = SecurityScreenState(currentOption = securityOption),
createTwinWalletState = twinsState,
cardTermsOfUseUrl = action.cardTou.getUrl(action.card)
)
@ -174,14 +173,15 @@ private fun handleSecurityAction(
}
is DetailsAction.ManageSecurity.SaveChanges.Success -> {
// Setting options to show only LongTap from now on for non-twins
val currentOption = state.securityScreenState?.selectedOption
state.copy(
securityScreenState = state.securityScreenState?.copy(
currentOption = currentOption,
allowedOptions = state.card?.let {
prepareAllowedSecurityOptions(it, currentOption) }
?: EnumSet.of(SecurityOption.LongTap)
))
securityScreenState = state.securityScreenState?.copy(
currentOption = state.securityScreenState.selectedOption,
allowedOptions = state.card?.let {
prepareAllowedSecurityOptions(
it, state.securityScreenState.selectedOption
)
} ?: EnumSet.of(SecurityOption.LongTap)
))
}
else -> state

View file

@ -108,14 +108,8 @@ class WalletMiddleware {
)
when (result) {
is CompletionResult.Success -> {
val card = globalState?.scanNoteResponse?.card?.let {
result.data.copy(
isPin1Default = it.isPin1Default,
isPin2Default = it.isPin2Default,
)
} ?: result.data
val scanNoteResponse =
globalState?.scanNoteResponse?.copy(card = card)
globalState?.scanNoteResponse?.copy(card = result.data)
scanNoteResponse?.let {
globalState.tapWalletManager.onCardScanned(scanNoteResponse)
}