refactor: remove synthetic added_at field, use created_at from bookmark list event

This commit is contained in:
Gigi
2025-10-22 12:18:43 +02:00
parent 49eb6855ca
commit 8bb871913b
8 changed files with 23 additions and 36 deletions

View File

@@ -87,7 +87,7 @@ export const renderParsedContent = (parsedContent: ParsedContent) => {
export const sortIndividualBookmarks = (items: IndividualBookmark[]) => {
return items
.slice()
.sort((a, b) => ((b.added_at || 0) - (a.added_at || 0)) || ((b.created_at || 0) - (a.created_at || 0)))
.sort((a, b) => (b.created_at || 0) - (a.created_at || 0))
}
export function groupIndividualBookmarks(items: IndividualBookmark[]) {

View File

@@ -51,7 +51,7 @@ export function deriveLinksFromBookmarks(bookmarks: Bookmark[]): ReadItem[] {
summary,
image,
readingProgress: 0,
readingTimestamp: bookmark.added_at || bookmark.created_at
readingTimestamp: bookmark.created_at
}
linksMap.set(url, item)

View File

@@ -49,7 +49,7 @@ export function deriveReadsFromBookmarks(bookmarks: Bookmark[]): ReadItem[] {
source: 'bookmark',
type: 'article',
readingProgress: 0,
readingTimestamp: bookmark.added_at || bookmark.created_at,
readingTimestamp: bookmark.created_at,
title,
summary,
image,