Compare commits

..

No commits in common. "5a2a0ad9c4f4130ba844768a628c76ecf4b04fd8" and "8b4f1a8973abe0a395cacf9617aab80bb606bf61" have entirely different histories.

2 changed files with 4 additions and 12 deletions

View File

@ -109,7 +109,6 @@ export const MainLayout = () => {
if (pubkey && !hasSubscribed.current) {
// Call `subscribeForSigits` only if it hasn't been called before
// #193 disabled websocket subscribtion, until #194 is done
subscribeForSigits(pubkey)
// Mark `subscribeForSigits` as called

View File

@ -859,16 +859,9 @@ export const subscribeForSigits = async (pubkey: string) => {
'#p': [pubkey]
}
// Process the received event synchronously
const events = await relayController.fetchEvents(filter, relaySet.read)
for (const e of events) {
await processReceivedEvent(e)
}
// Async processing of the events has a race condition
// relayController.subscribeForEvents(filter, relaySet.read, (event) => {
// processReceivedEvent(event)
// })
relayController.subscribeForEvents(filter, relaySet.read, (event) => {
processReceivedEvent(event) // Process the received event
})
}
const processReceivedEvent = async (event: Event, difficulty: number = 5) => {
@ -914,7 +907,7 @@ const processReceivedEvent = async (event: Event, difficulty: number = 5) => {
if (!meta) return
await updateUsersAppData(meta)
updateUsersAppData(meta)
}
/**