Updated on 2026-08-14
This commit is contained in:
commit
df4ac8ec69
2 changed files with 19 additions and 4 deletions
|
|
@ -175,12 +175,18 @@ private fun handleSecurityAction(
|
|||
state.copy(confirmScreenState = confirmScreenState)
|
||||
}
|
||||
is DetailsAction.ManageSecurity.SaveChanges.Success -> {
|
||||
// Setting options to show only LongTap from now on
|
||||
// Setting options to show only LongTap from now on for non-twins
|
||||
val card = if (state.card?.isTwinCard() == true) {
|
||||
state.card
|
||||
} else {
|
||||
state.card?.copy(isPin1Default = true, isPin2Default = true)
|
||||
}
|
||||
state.copy(
|
||||
card = state.card?.copy(isPin1Default = true, isPin2Default = true),
|
||||
card = card,
|
||||
securityScreenState = state.securityScreenState?.copy(
|
||||
currentOption = state.securityScreenState.selectedOption,
|
||||
allowedOptions = EnumSet.of(SecurityOption.LongTap)
|
||||
allowedOptions = card?.let { prepareAllowedSecurityOptions(it) }
|
||||
?: EnumSet.of(SecurityOption.LongTap)
|
||||
))
|
||||
}
|
||||
|
||||
|
|
@ -194,6 +200,9 @@ private fun prepareAllowedSecurityOptions(card: Card): EnumSet<SecurityOption> {
|
|||
val isDefaultPin2 = card.isPin2Default != false
|
||||
|
||||
val allowedSecurityOptions = EnumSet.noneOf(SecurityOption::class.java)
|
||||
if (card.isTwinCard()) {
|
||||
allowedSecurityOptions.add(SecurityOption.PassCode)
|
||||
}
|
||||
if ((isDefaultPin1 && isDefaultPin2) || !prohibitDefaultPin) {
|
||||
allowedSecurityOptions.add(SecurityOption.LongTap)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,8 +105,14 @@ 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 = result.data)
|
||||
globalState?.scanNoteResponse?.copy(card = card)
|
||||
scanNoteResponse?.let {
|
||||
globalState.tapWalletManager.onCardScanned(scanNoteResponse)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue