Fix crash for some feeds in TimelineTab

This commit is contained in:
Shinokuni 2024-04-07 17:34:56 +02:00
parent 16e70519e4
commit da51f504e4
1 changed files with 17 additions and 13 deletions

View File

@ -321,20 +321,24 @@ object TimelineTab : Tab {
count = items.itemCount, count = items.itemCount,
key = items.itemKey { it.item.id }, key = items.itemKey { it.item.id },
) { itemCount -> ) { itemCount ->
val itemWithFeed = items[itemCount]!! val itemWithFeed = items[itemCount]
TimelineItem( if (itemWithFeed != null) {
itemWithFeed = itemWithFeed, TimelineItem(
onClick = { itemWithFeed = itemWithFeed,
viewModel.setItemRead(itemWithFeed.item) onClick = {
navigator.push(ItemScreen()) viewModel.setItemRead(itemWithFeed.item)
}, navigator.push(ItemScreen(itemWithFeed.item.id))
onFavorite = { viewModel.updateStarState(itemWithFeed.item) }, },
onShare = { onFavorite = {
viewModel.shareItem(itemWithFeed.item, context) viewModel.updateStarState(itemWithFeed.item)
}, },
compactLayout = true onShare = {
) viewModel.shareItem(itemWithFeed.item, context)
},
compactLayout = true
)
}
} }
} }