feat: improve private bookmark handling

- Use proper error handling for getHiddenBookmarks
- Add detailed logging to understand what's happening
- The browser extension should be triggered automatically when needed
- This follows the applesauce examples pattern for decryption
This commit is contained in:
Gigi
2025-10-02 10:14:16 +02:00
parent 82c63e5d18
commit 610de95481

View File

@@ -115,12 +115,20 @@ export const fetchBookmarks = async (
const bookmarkListEvent = bookmarkListEvents[0]
console.log('Found bookmark list event:', bookmarkListEvent.id)
// Use applesauce helpers to get all bookmarks (public and private)
// Use applesauce helpers to get public bookmarks
const publicBookmarks = Helpers.getPublicBookmarks(bookmarkListEvent)
const privateBookmarks = Helpers.getHiddenBookmarks(bookmarkListEvent)
console.log('Public bookmarks:', publicBookmarks)
console.log('Private bookmarks:', privateBookmarks)
// Try to get private bookmarks - this should trigger browser extension if needed
let privateBookmarks = null
try {
console.log('Attempting to get hidden bookmarks...')
privateBookmarks = Helpers.getHiddenBookmarks(bookmarkListEvent)
console.log('Private bookmarks result:', privateBookmarks)
} catch (error) {
console.log('Failed to get private bookmarks:', error)
privateBookmarks = null
}
// Process bookmarks using DRY helper function