fix swipe to mark read article issue (#516)

This commit is contained in:
kid1412621 2024-01-12 12:17:02 +08:00 committed by GitHub
parent cd135cd756
commit 6aa54a0594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -119,7 +119,7 @@ abstract class AbstractRssRepository(
)
}
feedId != null -> {
feedId != null && articleId == null -> {
articleDao.markAllAsReadByFeedId(
accountId = accountId,
feedId = feedId,

View File

@ -162,7 +162,7 @@ fun ArticleItem(
}
@ExperimentalMaterialApi
@Composable
fun swipeToDismiss(
fun SwipeableArticleItem(
articleWithFeed: ArticleWithFeed,
onClick: (ArticleWithFeed) -> Unit = {},
onSwipeOut: (ArticleWithFeed) -> Unit = {},

View File

@ -25,8 +25,8 @@ fun LazyListScope.ArticleList(
when (val item = pagingItems.peek(index)) {
is ArticleFlowItem.Article -> {
item(key = item.articleWithFeed.article.id) {
swipeToDismiss(
articleWithFeed = (pagingItems[index] as ArticleFlowItem.Article).articleWithFeed,
SwipeableArticleItem(
articleWithFeed = item.articleWithFeed,
onClick = { onClick(it) },
onSwipeOut = { onSwipeOut(it) }
)