remove broken globalThis error type.

This commit is contained in:
fiatjaf 2023-02-08 11:46:49 -03:00
parent 3710866430
commit 4485c8ed5e
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
1 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ export function relayInit(
var listeners: {
connect: Array<() => void>
disconnect: Array<() => void>
error: Array<(e: globalThis.Event) => void>
error: Array<() => void>
notice: Array<(msg: string) => void>
} = {
connect: [],
@ -77,9 +77,9 @@ export function relayInit(
setOpen()
resolve()
}
ws.onerror = (e: globalThis.Event) => {
listeners.error.forEach(cb => cb(e))
reject(e)
ws.onerror = () => {
listeners.error.forEach(cb => cb())
reject()
}
ws.onclose = async () => {
listeners.disconnect.forEach(cb => cb())