This commit is contained in:
Spencer Pogorzelski 2023-08-14 10:41:51 -07:00
parent d996adbd2e
commit a43cf04780

View file

@ -71,6 +71,7 @@ export class AdriftBareClient extends Client {
let initalCloseHappened = false;
ws.addEventListener("close", (e) => {
if (!initalCloseHappened) {
onReadyState(WebSocket.CONNECTING);
e.stopImmediatePropagation();
initalCloseHappened = true;
}
@ -98,8 +99,7 @@ export class AdriftBareClient extends Client {
send(data);
};
ws.close =
(code?: number, reason?: string) => {
ws.close = (code?: number, reason?: string) => {
close(code, reason);
onReadyState(WebSocket.CLOSING);
};