mirror of
https://github.com/dergigi/boris.git
synced 2026-01-17 05:44:24 +01:00
fix: load reading positions for web bookmarks (kind:39701)
Web bookmarks store their URL in the 'd' tag, not in content. The getBookmarkReadingProgress function was only extracting URLs from content, which meant reading progress indicators weren't showing for web bookmarks. Now it properly extracts URLs from the 'd' tag for kind:39701 bookmarks.
This commit is contained in:
@@ -105,7 +105,18 @@ export const BookmarkList: React.FC<BookmarkListProps> = ({
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
// For web bookmarks and other types, try to use URL if available
|
||||
|
||||
// For web bookmarks (kind:39701), URL is in the 'd' tag
|
||||
if (bookmark.kind === 39701) {
|
||||
const dTag = bookmark.tags.find(t => t[0] === 'd')?.[1]
|
||||
if (dTag) {
|
||||
// Ensure URL has protocol
|
||||
const url = dTag.startsWith('http') ? dTag : `https://${dTag}`
|
||||
return readingProgressMap.get(url)
|
||||
}
|
||||
}
|
||||
|
||||
// For other bookmark types, try to extract URL from content
|
||||
const urls = extractUrlsFromContent(bookmark.content)
|
||||
if (urls.length > 0) {
|
||||
return readingProgressMap.get(urls[0])
|
||||
|
||||
Reference in New Issue
Block a user