Fix sub?.removeAllListeners is not a function (#1469)

This commit is contained in:
ekzyis 2024-10-09 20:13:53 -05:00 committed by GitHub
parent 41da95b125
commit 7eaaa7ce44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -34,7 +34,10 @@ function subscribeForever (subscribe) {
}
if (sub.then) {
// sub is promise
sub.then(sub => sub.on('error', reject))
sub.then(resolved => {
sub = resolved
sub.on('error', reject)
})
} else {
sub.on('error', reject)
}