diff --git a/app/src/main/java/sh/sar/basedbank/ui/home/TransferFragment.kt b/app/src/main/java/sh/sar/basedbank/ui/home/TransferFragment.kt index cd2acae..0913e9b 100644 --- a/app/src/main/java/sh/sar/basedbank/ui/home/TransferFragment.kt +++ b/app/src/main/java/sh/sar/basedbank/ui/home/TransferFragment.kt @@ -984,17 +984,31 @@ class TransferFragment : Fragment() { updateTransferButton() val contact = contacts.firstOrNull { it.benefAccount == accountNumber } - if (contact != null) { - RecentsCache.save(requireContext(), RecentPick( - accountNumber = contact.benefAccount, - displayName = contact.benefNickName, - subtitle = subtitle, - colorHex = colorHex, - imageHash = imageHash, - isProfileImage = false - )) - if (imageHash != null) loadToPhoto(imageHash, isProfile = false) + val recentImageHash: String? + val recentIsProfileImage: Boolean + when { + ownAccount != null -> { + recentImageHash = ownAccount.profileImageHash + recentIsProfileImage = true + } + contact != null -> { + recentImageHash = contact.customerImgHash ?: imageHash + 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) {