This commit is contained in:
jusax23 2023-03-08 17:21:29 +01:00
parent 083bec3d30
commit 2671dda661
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41

View file

@ -38,7 +38,7 @@ export class wsClient {
let msgStr = msg.toString(); let msgStr = msg.toString();
debug("WebSocket", "reveived:", msgStr); debug("WebSocket", "reveived:", msgStr);
let json = JSON.parse(msgStr) as { act: string, id: number, data: any }; let json = JSON.parse(msgStr) as { act: string, id: number, data: any };
if (closed) { if (!this.open) {
socket.send(JSON.stringify({ socket.send(JSON.stringify({
id: json.id, id: json.id,
state: "error", state: "error",
@ -131,6 +131,7 @@ export class wsClient {
}); });
socket.on('close', () => { socket.on('close', () => {
this.open = false;
var i = clients.indexOf(this); var i = clients.indexOf(this);
delete clients[i]; delete clients[i];
if (i >= 0) { if (i >= 0) {