mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 08:38:50 +00:00
some small bugs codebuff found.
This commit is contained in:
@@ -90,6 +90,7 @@ export class AbstractRelay {
|
||||
try {
|
||||
this.ws = new this._WebSocket(this.url)
|
||||
} catch (err) {
|
||||
clearTimeout(this.connectionTimeoutHandle)
|
||||
reject(err)
|
||||
return
|
||||
}
|
||||
@@ -101,6 +102,7 @@ export class AbstractRelay {
|
||||
}
|
||||
|
||||
this.ws.onerror = ev => {
|
||||
clearTimeout(this.connectionTimeoutHandle)
|
||||
reject((ev as any).message || 'websocket error')
|
||||
if (this._connected) {
|
||||
this._connected = false
|
||||
|
||||
Reference in New Issue
Block a user