mirror of
https://github.com/dergigi/boris.git
synced 2026-01-27 18:54:20 +01:00
fix(reads/links): keep DRY filtering but enforce type separation (articles vs external) for /me/reads and /me/links filters
This commit is contained in:
@@ -620,9 +620,17 @@ const Me: React.FC<MeProps> = ({
|
||||
return item
|
||||
})
|
||||
|
||||
// Apply reading progress filter
|
||||
const filteredReads = filterByReadingProgress(readsWithProgress, readingProgressFilter, highlights)
|
||||
const filteredLinks = filterByReadingProgress(linksWithProgress, readingProgressFilter, highlights)
|
||||
// Apply reading progress filter with simple type separation to keep Views distinct and DRY
|
||||
const filteredReads = filterByReadingProgress(
|
||||
readsWithProgress.filter(item => item.type === 'article'),
|
||||
readingProgressFilter,
|
||||
highlights
|
||||
)
|
||||
const filteredLinks = filterByReadingProgress(
|
||||
linksWithProgress.filter(item => item.type === 'external'),
|
||||
readingProgressFilter,
|
||||
highlights
|
||||
)
|
||||
const sections: Array<{ key: string; title: string; items: IndividualBookmark[] }> =
|
||||
groupingMode === 'flat'
|
||||
? [{ key: 'all', title: `All Bookmarks (${filteredBookmarks.length})`, items: filteredBookmarks }]
|
||||
|
||||
Reference in New Issue
Block a user