@spteck/react-controls-v2 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -25471,16 +25471,30 @@ function useStreamRequest() {
|
|
|
25471
25471
|
}
|
|
25472
25472
|
throw new Error(currentData || "An error occurred during streaming");
|
|
25473
25473
|
}
|
|
25474
|
+
} else if (currentEvent === "done") {
|
|
25475
|
+
done = true;
|
|
25476
|
+
} else if (currentData && currentEvent !== "tool") {
|
|
25477
|
+
try {
|
|
25478
|
+
const parsedData = JSON.parse(currentData);
|
|
25479
|
+
if (!parsedData.status || Object.keys(parsedData).length > 1) {
|
|
25480
|
+
accumulatedData += currentData;
|
|
25481
|
+
setData(accumulatedData);
|
|
25482
|
+
if (onChunk) {
|
|
25483
|
+
onChunk(currentData);
|
|
25484
|
+
}
|
|
25485
|
+
}
|
|
25486
|
+
} catch {
|
|
25487
|
+
accumulatedData += currentData;
|
|
25488
|
+
setData(accumulatedData);
|
|
25489
|
+
if (onChunk) {
|
|
25490
|
+
onChunk(currentData);
|
|
25491
|
+
}
|
|
25492
|
+
}
|
|
25474
25493
|
}
|
|
25475
25494
|
currentEvent = "";
|
|
25476
25495
|
currentData = "";
|
|
25477
25496
|
}
|
|
25478
25497
|
}
|
|
25479
|
-
accumulatedData += chunk;
|
|
25480
|
-
setData(accumulatedData);
|
|
25481
|
-
if (onChunk) {
|
|
25482
|
-
onChunk(chunk);
|
|
25483
|
-
}
|
|
25484
25498
|
}
|
|
25485
25499
|
}
|
|
25486
25500
|
} catch (err) {
|