Fix toggling favorites in ItemListFragment

This commit is contained in:
Niels van Velzen 2024-08-18 17:07:07 +02:00 committed by Niels van Velzen
parent 299751156d
commit a4ec607543

View File

@ -89,7 +89,7 @@ fun ItemListFragment.toggleFavorite(item: BaseItemDto, callback: (item: BaseItem
lifecycleScope.launch {
val userData = itemMutationRepository.setFavorite(
item = item.id,
favorite = item.userData?.isFavorite ?: true
favorite = !(item.userData?.isFavorite ?: false)
)
callback(item.copy(userData = userData))
}