bug fix that took user to default card from dashboard instead of the card user selected
Auto Tag on Version Change / check-version (push) Has been cancelled

This commit is contained in:
2026-05-29 16:45:19 +05:00
parent 3db077cf9a
commit f5f52829c7
2 changed files with 23 additions and 8 deletions
@@ -393,9 +393,10 @@ class DashboardFragment : Fragment() {
if (isMib) {
Toast.makeText(requireContext(), R.string.mib_qr_nfc_not_supported, Toast.LENGTH_SHORT).show()
} else {
val accountNumber = (item as CardItem.Bml).account.accountNumber
(requireActivity() as HomeActivity).navigateTo(
R.id.nav_pay_with_card,
CardsFragment.newInstanceWithAutoTapMode()
CardsFragment.newInstanceWithAutoTapMode(accountNumber)
)
}
}
@@ -684,16 +684,26 @@ ViewCompat.setOnApplyWindowInsetsListener(binding.contentLayout) { v, insets ->
updateCardInfo(currentCardPosition)
}
// Auto-enter tap mode when launched from shortcut or NFC prompt
// Auto-enter tap mode when launched from shortcut, NFC prompt, or dashboard
if (!autoTapModeTriggered && arguments?.getBoolean(ARG_AUTO_TAP_MODE) == true) {
val defaultCard = cards.filterIsInstance<CardItem.Bml>().firstOrNull()
if (defaultCard != null) {
val targetAccount = arguments?.getString(ARG_AUTO_TAP_ACCOUNT)
val targetCard = if (targetAccount != null)
cards.filterIsInstance<CardItem.Bml>().firstOrNull { it.account.accountNumber == targetAccount }
else
cards.filterIsInstance<CardItem.Bml>().firstOrNull()
if (targetCard != null) {
autoTapModeTriggered = true
// Scroll to the target card first
val pos = cards.indexOf(targetCard)
if (pos >= 0) {
currentCardPosition = pos
binding.rvCards.scrollToPosition(pos)
}
val prefs = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE)
if (prefs.getBoolean("biometrics_transfer_confirm", false)) {
showBiometricPromptForTap(defaultCard)
showBiometricPromptForTap(targetCard)
} else {
setTapMode(true, defaultCard)
setTapMode(true, targetCard)
}
}
}
@@ -944,8 +954,12 @@ ViewCompat.setOnApplyWindowInsetsListener(binding.contentLayout) { v, insets ->
companion object {
private const val ARG_AUTO_TAP_MODE = "auto_tap_mode"
fun newInstanceWithAutoTapMode() = CardsFragment().apply {
arguments = Bundle().apply { putBoolean(ARG_AUTO_TAP_MODE, true) }
private const val ARG_AUTO_TAP_ACCOUNT = "auto_tap_account"
fun newInstanceWithAutoTapMode(accountNumber: String? = null) = CardsFragment().apply {
arguments = Bundle().apply {
putBoolean(ARG_AUTO_TAP_MODE, true)
if (accountNumber != null) putString(ARG_AUTO_TAP_ACCOUNT, accountNumber)
}
}
fun cardImageAsset(card: MibCard): String? = when (card.cardType) {