refactor: use applesauce EventStore for offline event management

Major improvements:
- Store highlights in EventStore immediately when created
- Query EventStore instead of local relays for offline sync
- Pass eventStore to highlight creation service and hooks
- Simplified offline sync: no more relay queries, just EventStore lookups
- More efficient and reliable offline event tracking
- Better integration with applesauce architecture

Benefits:
- Faster sync (no relay queries needed)
- More reliable (events always in EventStore)
- Cleaner code (leveraging applesauce patterns)
- Better separation of concerns
This commit is contained in:
Gigi
2025-10-09 13:54:47 +01:00
parent 95162d4423
commit d294287c64
5 changed files with 45 additions and 56 deletions

View File

@@ -59,6 +59,7 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
useOfflineSync({
relayPool,
account: activeAccount,
eventStore,
relayStatuses,
enabled: true
})
@@ -129,6 +130,7 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
} = useHighlightCreation({
activeAccount,
relayPool,
eventStore,
currentArticle,
selectedUrl,
readerContent,