Emit send, even when it doesn't happen

This commit is contained in:
Jon Staab
2024-11-08 16:22:00 -08:00
parent 2878aeec64
commit 65719412a4
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -316,6 +316,7 @@ const _executeSubscription = (sub: Subscription) => {
emitter.emit(SubscriptionEvent.Send) emitter.emit(SubscriptionEvent.Send)
}) })
} else { } else {
emitter.emit(SubscriptionEvent.Send)
onComplete() onComplete()
} }
} }
+3 -1
View File
@@ -207,7 +207,9 @@ export class Nip46Broker extends Emitter {
while (this.#queue.length > 0) { while (this.#queue.length > 0) {
const [{method, params, resolve}] = this.#queue.splice(0, 1) const [{method, params, resolve}] = this.#queue.splice(0, 1)
this.request(method, params).then(resolve) this.request(method, params).then(resolve, error => {
console.error(`Failed to send nip46 request`, {method, params, error})
})
} }
} finally { } finally {
this.#processing = false this.#processing = false