mirror of
https://github.com/dergigi/boris.git
synced 2026-01-20 07:14:44 +01:00
fix(bookmarks): sort by display time (created_at || listUpdatedAt) desc; nulls last
This commit is contained in:
@@ -87,13 +87,8 @@ export const renderParsedContent = (parsedContent: ParsedContent) => {
|
||||
|
||||
// Sorting and grouping for bookmarks
|
||||
export const sortIndividualBookmarks = (items: IndividualBookmark[]) => {
|
||||
return items
|
||||
.slice()
|
||||
.sort((a, b) => {
|
||||
const aTs = a.listUpdatedAt ?? -Infinity
|
||||
const bTs = b.listUpdatedAt ?? -Infinity
|
||||
return bTs - aTs
|
||||
})
|
||||
const getSortTime = (b: IndividualBookmark) => b.created_at ?? b.listUpdatedAt ?? -Infinity
|
||||
return items.slice().sort((a, b) => getSortTime(b) - getSortTime(a))
|
||||
}
|
||||
|
||||
export function groupIndividualBookmarks(items: IndividualBookmark[]) {
|
||||
|
||||
Reference in New Issue
Block a user