@mastra/playground-ui 3.0.0-alpha.2 → 3.0.0-alpha.3
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.es.js +10 -5
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -4862,6 +4862,7 @@ function usePolling({
|
|
|
4862
4862
|
|
|
4863
4863
|
const useTraces = (componentName, baseUrl, isWorkflow = false) => {
|
|
4864
4864
|
const [traces, setTraces] = useState([]);
|
|
4865
|
+
const { setTraces: setTraceContextTraces } = useContext(TraceContext);
|
|
4865
4866
|
const client = useMemo(
|
|
4866
4867
|
() => new MastraClient({
|
|
4867
4868
|
baseUrl: baseUrl || ""
|
|
@@ -4884,11 +4885,15 @@ const useTraces = (componentName, baseUrl, isWorkflow = false) => {
|
|
|
4884
4885
|
throw error2;
|
|
4885
4886
|
}
|
|
4886
4887
|
}, [client, componentName, isWorkflow]);
|
|
4887
|
-
const onSuccess = useCallback(
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4888
|
+
const onSuccess = useCallback(
|
|
4889
|
+
(newTraces) => {
|
|
4890
|
+
if (newTraces.length > 0) {
|
|
4891
|
+
setTraces(() => newTraces);
|
|
4892
|
+
setTraceContextTraces(() => newTraces);
|
|
4893
|
+
}
|
|
4894
|
+
},
|
|
4895
|
+
[setTraceContextTraces]
|
|
4896
|
+
);
|
|
4892
4897
|
const onError = useCallback((error2) => {
|
|
4893
4898
|
toast.error(error2.message);
|
|
4894
4899
|
}, []);
|