From 9c6b9f9b3d453b1aab2632eedd76c57338f242fe Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 19 Aug 2023 05:23:04 +0200 Subject: [PATCH] Fix useWs not reconnecting after an error --- todoblue/src/app/(api)/useWs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todoblue/src/app/(api)/useWs.ts b/todoblue/src/app/(api)/useWs.ts index 9b80b82..d6ac4b0 100644 --- a/todoblue/src/app/(api)/useWs.ts +++ b/todoblue/src/app/(api)/useWs.ts @@ -84,7 +84,7 @@ export function useWs(url: string | undefined, {onclose, onerror, onmessage, ono } sock.onclose = (event) => { console.debug("[useWebSocket] Closed connection:", event) - dispatch({event: "stateChange"}) + dispatch({event: "disconnect"}); onclose?.({event, closeWebSocket}); } sock.onerror = (event) => {