Fix recipe list diff calculation
This commit is contained in:
@@ -42,11 +42,13 @@ class RecipesPagingAdapter private constructor(
|
|||||||
|
|
||||||
private object RecipeDiffCallback : DiffUtil.ItemCallback<RecipeSummaryEntity>() {
|
private object RecipeDiffCallback : DiffUtil.ItemCallback<RecipeSummaryEntity>() {
|
||||||
override fun areItemsTheSame(
|
override fun areItemsTheSame(
|
||||||
oldItem: RecipeSummaryEntity, newItem: RecipeSummaryEntity
|
oldItem: RecipeSummaryEntity,
|
||||||
|
newItem: RecipeSummaryEntity,
|
||||||
): Boolean = oldItem.remoteId == newItem.remoteId
|
): Boolean = oldItem.remoteId == newItem.remoteId
|
||||||
|
|
||||||
override fun areContentsTheSame(
|
override fun areContentsTheSame(
|
||||||
oldItem: RecipeSummaryEntity, newItem: RecipeSummaryEntity
|
oldItem: RecipeSummaryEntity,
|
||||||
): Boolean = oldItem.name == newItem.name && oldItem.slug == newItem.slug
|
newItem: RecipeSummaryEntity,
|
||||||
|
): Boolean = oldItem == newItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user