contact picker recents will not put most recent contact top

This commit is contained in:
2026-06-13 23:17:57 +05:00
parent 3182e14873
commit e997969070
@@ -984,17 +984,31 @@ class TransferFragment : Fragment() {
updateTransferButton() updateTransferButton()
val contact = contacts.firstOrNull { it.benefAccount == accountNumber } val contact = contacts.firstOrNull { it.benefAccount == accountNumber }
if (contact != null) { val recentImageHash: String?
RecentsCache.save(requireContext(), RecentPick( val recentIsProfileImage: Boolean
accountNumber = contact.benefAccount, when {
displayName = contact.benefNickName, ownAccount != null -> {
subtitle = subtitle, recentImageHash = ownAccount.profileImageHash
colorHex = colorHex, recentIsProfileImage = true
imageHash = imageHash, }
isProfileImage = false contact != null -> {
)) recentImageHash = contact.customerImgHash ?: imageHash
if (imageHash != null) loadToPhoto(imageHash, isProfile = false) recentIsProfileImage = false
}
else -> {
recentImageHash = imageHash
recentIsProfileImage = false
}
} }
RecentsCache.save(requireContext(), RecentPick(
accountNumber = accountNumber,
displayName = displayName,
subtitle = subtitle,
colorHex = colorHex,
imageHash = recentImageHash,
isProfileImage = recentIsProfileImage
))
if (contact != null && imageHash != null) loadToPhoto(imageHash, isProfile = false)
} }
private fun prefillToFromContact(accountNumber: String, label: String) { private fun prefillToFromContact(accountNumber: String, label: String) {