v1.0.108 fix logic sse subscription
This commit is contained in:
parent
80d5799571
commit
2fd0d63a1c
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user