mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 11:43:35 +00:00
subPromise wasn't resolving, avoid that
This commit is contained in:
parent
c2a0b8362e
commit
c9b8a56f61
@ -60,8 +60,6 @@ const load = ({relays, filter, onChunk = null, shouldProcess = true, timeout = 5
|
||||
const allEvents = []
|
||||
|
||||
const attemptToComplete = async force => {
|
||||
const sub = await subPromise
|
||||
|
||||
// If we've already unsubscribed we're good
|
||||
if (completed) {
|
||||
return
|
||||
@ -78,7 +76,7 @@ const load = ({relays, filter, onChunk = null, shouldProcess = true, timeout = 5
|
||||
}
|
||||
|
||||
if (isDone || force) {
|
||||
sub.unsub()
|
||||
subPromise.then(sub => sub.unsub())
|
||||
resolve(allEvents)
|
||||
completed = true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user