Compare commits

..

No commits in common. "aa8214d015805b0700aea4c10d2b5b4e50197ed7" and "e48a3969904c1ec9759a60e9b21f998569ce6b13" 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) { if (pubkey && !hasSubscribed.current) {
// Call `subscribeForSigits` only if it hasn't been called before // Call `subscribeForSigits` only if it hasn't been called before
// #193 disabled websocket subscribtion, until #194 is done
subscribeForSigits(pubkey) subscribeForSigits(pubkey)
// Mark `subscribeForSigits` as called // Mark `subscribeForSigits` as called

View File

@ -859,16 +859,9 @@ export const subscribeForSigits = async (pubkey: string) => {
'#p': [pubkey] '#p': [pubkey]
} }
// Process the received event synchronously relayController.subscribeForEvents(filter, relaySet.read, (event) => {
const events = await relayController.fetchEvents(filter, relaySet.read) processReceivedEvent(event) // Process the received event
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)
// })
} }
const processReceivedEvent = async (event: Event, difficulty: number = 5) => { const processReceivedEvent = async (event: Event, difficulty: number = 5) => {
@ -914,7 +907,7 @@ const processReceivedEvent = async (event: Event, difficulty: number = 5) => {
if (!meta) return if (!meta) return
await updateUsersAppData(meta) updateUsersAppData(meta)
} }
/** /**