From cf5d37814793ad949885b413f7ee6d5a02cea137 Mon Sep 17 00:00:00 2001 From: Spencer Pogorzelski <34356756+Scoder12@users.noreply.github.com> Date: Sun, 13 Aug 2023 21:36:06 -0700 Subject: [PATCH] tiny WIP client fixes --- client/src/AdriftClient.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/AdriftClient.ts b/client/src/AdriftClient.ts index 1b11838..80088eb 100644 --- a/client/src/AdriftClient.ts +++ b/client/src/AdriftClient.ts @@ -72,11 +72,11 @@ export class AdriftBareClient extends Client { let { send, close } = this.connection.wsconnect( remote, () => { - onReadyState(WebSocketFields.OPEN); + onReadyState(WebSocket.OPEN); ws.dispatchEvent(new Event("open")); }, () => { - onReadyState(WebSocketFields.CLOSED); + onReadyState(WebSocket.CLOSED); ws.dispatchEvent(new Event("close")); }, (data) => { @@ -95,9 +95,12 @@ export class AdriftBareClient extends Client { // i can probably fix later but this is fine for now -CE (ws as any).__defineSetter__("send", () => {}); - (ws as any).__defineGetter__("close", (code?: number, reason?: string) => { - close(code, reason); - }); + (ws as any).__defineGetter__( + "close", + () => (code?: number, reason?: string) => { + close(code, reason); + } + ); return ws; }