mirror of
https://github.com/dergigi/boris.git
synced 2026-01-22 00:04:30 +01:00
fix: ensure bookmarks are sorted newest first after merging lists
- Re-sort all individual bookmarks after flattening from multiple lists - Sort by added_at first, then fall back to created_at - Prevents interleaving of sorted lists from breaking overall order - Ensures newest bookmarks always appear at the top
This commit is contained in:
@@ -37,9 +37,10 @@ export const BookmarkList: React.FC<BookmarkListProps> = ({
|
||||
loading = false
|
||||
}) => {
|
||||
// Merge and flatten all individual bookmarks from all lists
|
||||
// They're already sorted by date in the service layer
|
||||
// Re-sort after flattening to ensure newest first across all lists
|
||||
const allIndividualBookmarks = bookmarks.flatMap(b => b.individualBookmarks || [])
|
||||
.filter(ib => ib.content || ib.kind === 30023 || ib.kind === 39701)
|
||||
.sort((a, b) => ((b.added_at || 0) - (a.added_at || 0)) || ((b.created_at || 0) - (a.created_at || 0)))
|
||||
|
||||
if (isCollapsed) {
|
||||
// Check if the selected URL is in bookmarks
|
||||
|
||||
Reference in New Issue
Block a user