From 73c24923f3b85a78a5fe0be650625525b102ca86 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 12 Dec 2023 10:08:40 +0100 Subject: [PATCH] fix(client): catch closing websocket --- WebSocketClient/src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WebSocketClient/src/main.ts b/WebSocketClient/src/main.ts index fc2936d..84a46dd 100644 --- a/WebSocketClient/src/main.ts +++ b/WebSocketClient/src/main.ts @@ -85,6 +85,11 @@ const createWebSocket = (url: string): WebSocket => { createWebSocket(url); }); }; + webSocket.onclose = () => { + setTimeout(() => { + createWebSocket(url); + }, 500); + } return webSocket; };