v1.0.108 fix logic sse subscription

This commit is contained in:
Nastya 2025-05-18 14:40:57 +03:00
parent 80d5799571
commit 2fd0d63a1c
2 changed files with 2 additions and 2 deletions

@ -30,7 +30,7 @@ export function useSSESubscription<T>({ enabled = true, url, onNewData, onDiscon
console.log("EVENT") console.log("EVENT")
console.log(event) console.log(event)
const newData = JSON.parse(event.data) as T; const newData = JSON.parse(event.data) as T;
if (typeof newData === "object" && newData !== null && "event" in newData && newData.event !== "ping") { if (!(typeof newData === "object" && newData !== null && "event" in newData && newData.event === "ping")) {
devlog(`new SSE: ${marker}`, newData); devlog(`new SSE: ${marker}`, newData);
onNewDataRef.current([newData]); onNewDataRef.current([newData]);
} }

@ -1,6 +1,6 @@
{ {
"name": "@frontend/kitui", "name": "@frontend/kitui",
"version": "1.0.99", "version": "1.0.107",
"description": "test", "description": "test",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",