Skip to content

Commit

Permalink
Compare line ID when diffing if available
Browse files Browse the repository at this point in the history
  • Loading branch information
mhoran committed Dec 7, 2024
1 parent 5f77a15 commit 7bfe380
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ class ChatLinesAdapter @MainThread constructor(
override fun getNewListSize() = newLines.size

override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
if (oldLines[oldItemPosition].id != null) {
return oldLines[oldItemPosition].id == newLines[newItemPosition].id
}
return oldLines[oldItemPosition].pointer == newLines[newItemPosition].pointer
}

Expand Down

0 comments on commit 7bfe380

Please sign in to comment.