mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 16:48:50 +00:00
@@ -78,9 +78,9 @@ export class AbstractRelay {
|
|||||||
this.connectionPromise = new Promise((resolve, reject) => {
|
this.connectionPromise = new Promise((resolve, reject) => {
|
||||||
this.connectionTimeoutHandle = setTimeout(() => {
|
this.connectionTimeoutHandle = setTimeout(() => {
|
||||||
reject('connection timed out')
|
reject('connection timed out')
|
||||||
|
this.connectionPromise = undefined
|
||||||
this.onclose?.()
|
this.onclose?.()
|
||||||
this.closeAllSubscriptions('relay connection timed out')
|
this.closeAllSubscriptions('relay connection timed out')
|
||||||
this.connectionPromise = undefined
|
|
||||||
}, this.connectionTimeout)
|
}, this.connectionTimeout)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -106,9 +106,9 @@ export class AbstractRelay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.ws.onclose = async () => {
|
this.ws.onclose = async () => {
|
||||||
|
this.connectionPromise = undefined
|
||||||
this.onclose?.()
|
this.onclose?.()
|
||||||
this.closeAllSubscriptions('relay connection closed')
|
this.closeAllSubscriptions('relay connection closed')
|
||||||
this.connectionPromise = undefined
|
|
||||||
this._connected = false
|
this._connected = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user