Updated on 2026-08-14

This commit is contained in:
Tangem 2022-03-05 18:14:10 +03:00
commit 30606cd99f
7 changed files with 53 additions and 54 deletions

View file

@ -153,7 +153,7 @@ class TangemSdkManager(private val tangemSdk: TangemSdk, private val context: Co
fun changeDisplayedCardIdNumbersCount(scanResponse: ScanResponse) {
tangemSdk.config.cardIdDisplayFormat = if (scanResponse.isTangemTwins()) {
CardIdDisplayFormat.LastLunh(4)
CardIdDisplayFormat.LastLuhn(4)
} else {
CardIdDisplayFormat.Full
}

View file

@ -71,7 +71,7 @@ class WalletCardsWidget(
)
leapfrogWidget.fold {
animator.doOnEnd {
// leapfrogWidget.initViews()
leapfrogWidget.initViews()
leapfrogWidget.unfold()
}
animator.start()

View file

@ -11,6 +11,7 @@ import com.tangem.common.CompletionResult
import com.tangem.common.core.TangemSdkError
import com.tangem.common.extensions.isZero
import com.tangem.common.services.Result
import com.tangem.operations.attestation.Attestation
import com.tangem.operations.attestation.OnlineCardVerifier
import com.tangem.tap.common.analytics.Analytics
import com.tangem.tap.common.extensions.*
@ -147,6 +148,9 @@ class WalletMiddleware {
store.dispatch(NavigationAction.PopBackTo(AppScreen.Home))
}
is WalletAction.LoadCardInfo -> {
val attestationFailed = action.card.attestation.status == Attestation.Status.Failed
store.dispatchOnMain(GlobalAction.SetIfCardVerifiedOnline(!attestationFailed))
scope.launch {
val response = OnlineCardVerifier().getCardInfo(
action.card.cardId, action.card.cardPublicKey
@ -156,13 +160,9 @@ class WalletMiddleware {
val actionList = listOf(
WalletAction.SetArtworkId(response.data.artwork?.id),
WalletAction.LoadArtwork(action.card, response.data.artwork?.id),
GlobalAction.SetIfCardVerifiedOnline(response.data.passed)
)
withMainContext { actionList.forEach { store.dispatch(it) } }
}
is Result.Failure -> {
store.dispatchOnMain(GlobalAction.SetIfCardVerifiedOnline(false))
}
}
store.dispatchOnMain(WalletAction.Warnings.CheckIfNeeded)
}

View file

@ -128,7 +128,7 @@ class SingleWalletView : WalletView {
val btnConfirm = if (state.tradeCryptoState.sellingAllowed ||
state.tradeCryptoState.buyingAllowed
) {
lButtonsShort.btnConfirmShort
lButtonsShort.btnConfirm
} else {
lButtonsLong.btnConfirmLong
}
@ -136,7 +136,7 @@ class SingleWalletView : WalletView {
val btnScan = if (state.tradeCryptoState.sellingAllowed ||
state.tradeCryptoState.buyingAllowed
) {
lButtonsShort.btnScanShort
lButtonsShort.btnScan
} else {
lButtonsLong.btnScanLong
}
@ -175,14 +175,14 @@ class SingleWalletView : WalletView {
else -> R.string.wallet_button_trade
}
val icon = when {
allowedToBuy && !allowedToSell -> R.drawable.ic_arrow_up_short_btn
!allowedToBuy && allowedToSell -> R.drawable.ic_arrow_down_short_button
allowedToBuy && allowedToSell -> R.drawable.ic_arrows_up_down_short_btn
allowedToBuy && !allowedToSell -> R.drawable.ic_arrow_up
!allowedToBuy && allowedToSell -> R.drawable.ic_arrow_down
allowedToBuy && allowedToSell -> R.drawable.ic_arrows_up_down
else -> null
}
with(binding) {
lButtonsShort.btnTrade.text = fragment?.getText(text)
lButtonsShort.btnTrade.setCompoundDrawablesWithIntrinsicBounds(0, icon ?: 0, 0, 0)
icon?.let { lButtonsShort.btnTrade.setIconResource(it) }
lButtonsShort.btnTrade.setOnClickListener { if (action != null) store.dispatch(action) }
}
}