mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-08 04:12:33 +00:00
Merge pull request #1107 from mpretty-cyro/fix/group-avatar-download-job-duplication
Fixed a few issues related to the GroupAvatarDownloadJob
This commit is contained in:
@@ -28,8 +28,11 @@ class HomeDiffUtil(
|
||||
if (isSameItem) { isSameItem = (oldItem.unreadCount == newItem.unreadCount) }
|
||||
if (isSameItem) { isSameItem = (oldItem.isPinned == newItem.isPinned) }
|
||||
|
||||
// Note: For some reason the 'hashCode' value can change after initialisation so we can't cache it
|
||||
if (isSameItem) { isSameItem = (oldItem.recipient.hashCode() == newItem.recipient.hashCode()) }
|
||||
// The recipient is passed as a reference and changes to recipients update the reference so we
|
||||
// need to cache the hashCode for the recipient and use that for diffing - unfortunately
|
||||
// recipient data is also loaded asyncronously which means every thread will refresh at least
|
||||
// once when the initial recipient data is loaded
|
||||
if (isSameItem) { isSameItem = (oldItem.initialRecipientHash == newItem.initialRecipientHash) }
|
||||
|
||||
// Note: Two instances of 'SpannableString' may not equate even though their content matches
|
||||
if (isSameItem) { isSameItem = (oldItem.getDisplayBody(context).toString() == newItem.getDisplayBody(context).toString()) }
|
||||
|
||||
Reference in New Issue
Block a user