mirror of
https://github.com/Ashinch/ReadYou.git
synced 2025-01-31 19:45:18 +01:00
fix swipe to mark read article issue (#516)
This commit is contained in:
parent
cd135cd756
commit
6aa54a0594
@ -119,7 +119,7 @@ abstract class AbstractRssRepository(
|
||||
)
|
||||
}
|
||||
|
||||
feedId != null -> {
|
||||
feedId != null && articleId == null -> {
|
||||
articleDao.markAllAsReadByFeedId(
|
||||
accountId = accountId,
|
||||
feedId = feedId,
|
||||
|
@ -162,7 +162,7 @@ fun ArticleItem(
|
||||
}
|
||||
@ExperimentalMaterialApi
|
||||
@Composable
|
||||
fun swipeToDismiss(
|
||||
fun SwipeableArticleItem(
|
||||
articleWithFeed: ArticleWithFeed,
|
||||
onClick: (ArticleWithFeed) -> Unit = {},
|
||||
onSwipeOut: (ArticleWithFeed) -> Unit = {},
|
||||
|
@ -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) }
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user