mirror of
https://github.com/dergigi/boris.git
synced 2025-12-30 13:04:57 +01:00
perf: publish bookmarks to relays in background
- Remove await on relayPool.publish() to not block UI - Bookmark modal now closes immediately after signing - Publishing happens asynchronously in the background - Added error handling for failed relay publishes - Fixes slow save issue caused by waiting for all 12 relays
This commit is contained in:
@@ -75,11 +75,16 @@ export async function createWebBookmark(
|
||||
// Sign the event
|
||||
const signedEvent = await factory.sign(draft)
|
||||
|
||||
// Publish to relays
|
||||
await relayPool.publish(relays, signedEvent)
|
||||
|
||||
console.log('✅ Web bookmark published:', signedEvent)
|
||||
// Publish to relays in the background (don't block UI)
|
||||
relayPool.publish(relays, signedEvent)
|
||||
.then(() => {
|
||||
console.log('✅ Web bookmark published to', relays.length, 'relays:', signedEvent)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.warn('⚠️ Some relays failed to publish bookmark:', err)
|
||||
})
|
||||
|
||||
// Return immediately so UI doesn't block
|
||||
return signedEvent
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user