huskies: merge 1058

This commit is contained in:
dave
2026-05-14 18:58:53 +00:00
parent 595777f366
commit 7d7e02f7b0
6 changed files with 133 additions and 18 deletions
+4
View File
@@ -59,6 +59,7 @@ export class ChatWebSocket {
) => void;
private onStatusUpdate?: (event: StatusEvent) => void;
private onConnected?: () => void;
private onDisconnected?: () => void;
private connected = false;
private closeTimer?: number;
private wsPath = DEFAULT_WS_PATH;
@@ -169,6 +170,7 @@ export class ChatWebSocket {
};
this.socket.onclose = () => {
if (this.shouldReconnect && this.connected) {
this.onDisconnected?.();
this._scheduleReconnect();
}
};
@@ -215,6 +217,7 @@ export class ChatWebSocket {
onLogEntry?: (timestamp: string, level: string, message: string) => void;
onStatusUpdate?: (event: StatusEvent) => void;
onConnected?: () => void;
onDisconnected?: () => void;
},
wsPath = DEFAULT_WS_PATH,
) {
@@ -236,6 +239,7 @@ export class ChatWebSocket {
this.onLogEntry = handlers.onLogEntry;
this.onStatusUpdate = handlers.onStatusUpdate;
this.onConnected = handlers.onConnected;
this.onDisconnected = handlers.onDisconnected;
this.wsPath = wsPath;
this.shouldReconnect = true;