Skip to content

Commit

Permalink
remove redundant get calls after publish.
Browse files Browse the repository at this point in the history
  • Loading branch information
AsaiToshiya committed Oct 17, 2024
1 parent 9961fa3 commit 286867a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,19 @@ export function Editor({

console.log('publishing...')

pool.current.trackRelays = true
let pub = Promise.allSettled(pool.current.publish(relays, event))
pub.then(async _ => {
clearTimeout(publishTimeout)
pool.current.trackRelays = true
await pool.current.querySync(relays, {ids: [event.id]})
pool.current.trackRelays = false
pool.current.seenOn.get(event.id).forEach(relay => {
showNotice(`event ${event.id.slice(0, 5)}… published to ${relay.url}.`)
setComment('')
setEditable(true)
})
})
.finally(() => {
pool.current.trackRelays = false
})
}

function showNotice(text) {
Expand Down

0 comments on commit 286867a

Please sign in to comment.