Skip to content

Commit

Permalink
fix swipe to mark read article issue (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
kid1412621 authored Jan 12, 2024
1 parent cd135cd commit 6aa54a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ abstract class AbstractRssRepository(
)
}

feedId != null -> {
feedId != null && articleId == null -> {
articleDao.markAllAsReadByFeedId(
accountId = accountId,
feedId = feedId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ fun ArticleItem(
}
@ExperimentalMaterialApi
@Composable
fun swipeToDismiss(
fun SwipeableArticleItem(
articleWithFeed: ArticleWithFeed,
onClick: (ArticleWithFeed) -> Unit = {},
onSwipeOut: (ArticleWithFeed) -> Unit = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
)
Expand Down

0 comments on commit 6aa54a0

Please sign in to comment.