Skip to content

Commit

Permalink
Fix next filter bug on folder overscroll
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Dec 15, 2024
1 parent 379f11a commit 8603f3b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions capy/src/main/java/com/jocmp/capy/articles/NextFilter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,20 @@ sealed class NextFilter {
}

is ArticleFilter.Folders -> {
val firstFeed = folders
val firstFolderFeed = folders
.find { it.title == filter.folderTitle }
?.feeds
?.firstOrNull() ?: return null
?.firstOrNull()

FeedFilter(feedID = firstFeed.id, folderTitle = filter.folderTitle)
val nextFeed = feeds.firstOrNull()

if (firstFolderFeed != null) {
FeedFilter(feedID = firstFolderFeed.id, folderTitle = filter.folderTitle)
} else if (nextFeed != null) {
FeedFilter(feedID = nextFeed.id, folderTitle = null)
} else {
null
}
}

is ArticleFilter.Feeds -> findNextFeed(filter, folders, feeds)
Expand Down

0 comments on commit 8603f3b

Please sign in to comment.