failed to connect to a websocket should reject the promise.
This commit is contained in:
parent
1437bbdb0f
commit
de26ee98c5
|
@ -112,7 +112,9 @@ export class AbstractRelay {
|
|||
}
|
||||
}
|
||||
|
||||
this.ws.onclose = async () => {
|
||||
this.ws.onclose = (ev) => {
|
||||
clearTimeout(this.connectionTimeoutHandle)
|
||||
reject((ev as any).message || 'websocket closed')
|
||||
if (this._connected) {
|
||||
this._connected = false
|
||||
this.connectionPromise = undefined
|
||||
|
|
2
jsr.json
2
jsr.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@nostr/tools",
|
||||
"version": "2.13.1",
|
||||
"version": "2.13.2",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./core": "./core.ts",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"type": "module",
|
||||
"name": "nostr-tools",
|
||||
"version": "2.13.1",
|
||||
"version": "2.13.2",
|
||||
"description": "Tools for making a Nostr client.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Loading…
Reference in New Issue