Updated on 2026-08-14
This commit is contained in:
parent
555be3d3e4
commit
f59c35616e
2 changed files with 13 additions and 5 deletions
|
|
@ -38,6 +38,14 @@ class TwinsHelper {
|
|||
return cardIdWithoutChecksum + checkSum
|
||||
}
|
||||
|
||||
fun getTwinCardIdForUser(cardId: String): String {
|
||||
if (cardId.length < 16) return cardId
|
||||
|
||||
val twinCardId = cardId.substring(11..14)
|
||||
val twinCardNumber = getTwinCardNumber(cardId)?.number ?: 1
|
||||
return "$twinCardId #$twinCardNumber"
|
||||
}
|
||||
|
||||
private val firstCardSeries = listOf("CB61", "CB64")
|
||||
private val secondCardSeries = listOf("CB62", "CB65")
|
||||
}
|
||||
|
|
@ -72,7 +80,5 @@ fun Card.isTwinCard(): Boolean {
|
|||
}
|
||||
|
||||
fun Card.getTwinCardIdForUser(): String {
|
||||
val twinCardId = this.cardId.substring(11..14)
|
||||
val twinCardNumber = TwinsHelper.getTwinCardNumber(this.cardId)?.number ?: 1
|
||||
return "$twinCardId #$twinCardNumber"
|
||||
return TwinsHelper.getTwinCardIdForUser(this.cardId)
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ import androidx.transition.TransitionInflater
|
|||
import com.squareup.picasso.Picasso
|
||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
||||
import com.tangem.tap.domain.twins.TwinsHelper
|
||||
import com.tangem.tap.features.wallet.redux.Artwork
|
||||
import com.tangem.tap.features.wallet.redux.WalletAction
|
||||
import com.tangem.tap.store
|
||||
|
|
@ -34,8 +35,9 @@ class TwinsOnboardingFragment : Fragment(R.layout.fragment_twin_cards) {
|
|||
|
||||
store.dispatch(WalletAction.TwinsAction.SetOnboardingShown)
|
||||
|
||||
val secondCardId = store.state.walletState.twinCardsState?.secondCardId
|
||||
val text = getString(R.string.twins_onboarding_description_format, secondCardId)
|
||||
val secondCardId = store.state.walletState.twinCardsState?.secondCardId ?: ""
|
||||
val secondTwinCardId = TwinsHelper.getTwinCardIdForUser(secondCardId)
|
||||
val text = getString(R.string.twins_onboarding_description_format, secondTwinCardId)
|
||||
tv_twin_cards_description_1.text = text
|
||||
|
||||
setOnClickListeners()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue