Skip to content

Commit f291e95

Browse files
authored
use new run URLs, attempt iii (#3938)
1 parent f7bd3d7 commit f291e95

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

skyvern-frontend/src/routes/workflows/hooks/useWorkflowRunQuery.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getClient } from "@/api/AxiosClient";
22
import { WorkflowRunStatusApiResponse } from "@/api/types";
33
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
4+
import { useFirstParam } from "@/hooks/useFirstParam";
45
import {
56
statusIsNotFinalized,
67
statusIsRunningOrQueued,
@@ -10,7 +11,8 @@ import { useParams } from "react-router-dom";
1011
import { useGlobalWorkflowsQuery } from "./useGlobalWorkflowsQuery";
1112

1213
function useWorkflowRunQuery() {
13-
const { workflowRunId, workflowPermanentId } = useParams();
14+
const workflowRunId = useFirstParam("workflowRunId", "runId");
15+
const { workflowPermanentId } = useParams();
1416
const credentialGetter = useCredentialGetter();
1517
const { data: globalWorkflows } = useGlobalWorkflowsQuery();
1618

skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunStream.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ZoomableImage } from "@/components/ZoomableImage";
44
import { useEffect, useState } from "react";
55
import { statusIsNotFinalized } from "@/routes/tasks/types";
66
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
7-
import { useParams } from "react-router-dom";
7+
import { useFirstParam } from "@/hooks/useFirstParam";
88
import { getRuntimeApiKey } from "@/util/env";
99
import { toast } from "@/components/ui/use-toast";
1010
import { useQueryClient } from "@tanstack/react-query";
@@ -25,12 +25,12 @@ const wssBaseUrl = import.meta.env.VITE_WSS_BASE_URL;
2525

2626
function WorkflowRunStream(props?: Props) {
2727
const alwaysShowStream = props?.alwaysShowStream ?? false;
28+
const workflowRunId = useFirstParam("workflowRunId", "runId");
2829
const { data: workflowRun } = useWorkflowRunWithWorkflowQuery();
2930
const [streamImgSrc, setStreamImgSrc] = useState<string>("");
3031
const showStream =
3132
alwaysShowStream || (workflowRun && statusIsNotFinalized(workflowRun));
3233
const credentialGetter = useCredentialGetter();
33-
const { workflowRunId } = useParams();
3434
const workflow = workflowRun?.workflow;
3535
const workflowPermanentId = workflow?.workflow_permanent_id;
3636
const queryClient = useQueryClient();

skyvern-frontend/src/util/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function clearRuntimeApiKey(): void {
9494
}
9595
}
9696

97-
const useNewRunsUrl = false as const;
97+
const useNewRunsUrl = true as const;
9898

9999
export {
100100
apiBaseUrl,

0 commit comments

Comments
 (0)