mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 19:46:42 +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 allEvents = []
|
||||||
|
|
||||||
const attemptToComplete = async force => {
|
const attemptToComplete = async force => {
|
||||||
const sub = await subPromise
|
|
||||||
|
|
||||||
// If we've already unsubscribed we're good
|
// If we've already unsubscribed we're good
|
||||||
if (completed) {
|
if (completed) {
|
||||||
return
|
return
|
||||||
@ -78,7 +76,7 @@ const load = ({relays, filter, onChunk = null, shouldProcess = true, timeout = 5
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isDone || force) {
|
if (isDone || force) {
|
||||||
sub.unsub()
|
subPromise.then(sub => sub.unsub())
|
||||||
resolve(allEvents)
|
resolve(allEvents)
|
||||||
completed = true
|
completed = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user