Jon/use new runs urls (#3930)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Status } from "@/api/types";
|
||||
import { useWorkflowRunQuery } from "../hooks/useWorkflowRunQuery";
|
||||
import { useWorkflowRunWithWorkflowQuery } from "../hooks/useWorkflowRunWithWorkflowQuery";
|
||||
import { ZoomableImage } from "@/components/ZoomableImage";
|
||||
import { useEffect, useState } from "react";
|
||||
import { statusIsNotFinalized } from "@/routes/tasks/types";
|
||||
@@ -25,12 +25,14 @@ const wssBaseUrl = import.meta.env.VITE_WSS_BASE_URL;
|
||||
|
||||
function WorkflowRunStream(props?: Props) {
|
||||
const alwaysShowStream = props?.alwaysShowStream ?? false;
|
||||
const { data: workflowRun } = useWorkflowRunQuery();
|
||||
const { data: workflowRun } = useWorkflowRunWithWorkflowQuery();
|
||||
const [streamImgSrc, setStreamImgSrc] = useState<string>("");
|
||||
const showStream =
|
||||
alwaysShowStream || (workflowRun && statusIsNotFinalized(workflowRun));
|
||||
const credentialGetter = useCredentialGetter();
|
||||
const { workflowRunId, workflowPermanentId } = useParams();
|
||||
const { workflowRunId } = useParams();
|
||||
const workflow = workflowRun?.workflow;
|
||||
const workflowPermanentId = workflow?.workflow_permanent_id;
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
useEffect(() => {
|
||||
@@ -73,6 +75,9 @@ function WorkflowRunStream(props?: Props) {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["workflowRun", workflowPermanentId, workflowRunId],
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["workflowRun", workflowRunId],
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["workflowTasks", workflowRunId],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user