mirror of
https://github.com/dergigi/boris.git
synced 2026-01-17 13:54:24 +01:00
refactor: simplify reads loading - don't require bookmarks
Reads don't actually need bookmarks to load. Reading progress (kind:39802) is independent and stands on its own. Bookmarks are just optional enrichment. Changed: - readsController.start() no longer takes bookmarks parameter - Pass empty array to fetchAllReads instead - Load reads immediately in App.tsx like highlights/writings - No more circular dependency on bookmarks loading first This is simpler and loads reading progress faster.
This commit is contained in:
@@ -117,7 +117,7 @@ function AppRoutes({
|
||||
|
||||
// Load reads (controller manages its own state)
|
||||
if (pubkey && eventStore && !readsController.isLoadedFor(pubkey)) {
|
||||
readsController.start({ relayPool, eventStore, pubkey, bookmarks })
|
||||
readsController.start({ relayPool, eventStore, pubkey })
|
||||
}
|
||||
|
||||
// Start centralized nostrverse highlights controller (non-blocking)
|
||||
|
||||
@@ -109,10 +109,9 @@ class ReadsController {
|
||||
relayPool: RelayPool
|
||||
eventStore: IEventStore
|
||||
pubkey: string
|
||||
bookmarks: Bookmark[]
|
||||
force?: boolean
|
||||
}): Promise<void> {
|
||||
const { relayPool, eventStore, pubkey, bookmarks, force = false } = params
|
||||
const { relayPool, eventStore, pubkey, force = false } = params
|
||||
const startGeneration = this.generation
|
||||
|
||||
// Skip if already loaded for this pubkey (unless forced)
|
||||
@@ -129,7 +128,7 @@ class ReadsController {
|
||||
|
||||
// Stream items as they're fetched
|
||||
// This updates the UI progressively as reading progress, marks as read, bookmarks arrive
|
||||
await fetchAllReads(relayPool, pubkey, bookmarks, (item) => {
|
||||
await fetchAllReads(relayPool, pubkey, [], (item) => {
|
||||
// Check if this generation is still active (user didn't log out)
|
||||
if (startGeneration !== this.generation) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user