Fix recipe list diff calculation

This commit is contained in:
Kirill Kamakin
2022-12-13 20:35:17 +01:00
parent 4334fdaa6a
commit af390ebcaf

View File

@@ -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
} }
} }