Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor status util function #1137

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions skyvern-frontend/src/api/utils.ts

This file was deleted.

4 changes: 2 additions & 2 deletions skyvern-frontend/src/routes/tasks/detail/TaskDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import { CopyIcon, PlayIcon, ReloadIcon } from "@radix-ui/react-icons";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { Link, NavLink, Outlet, useParams } from "react-router-dom";
import { useTaskQuery } from "./hooks/useTaskQuery";
import { taskIsFinalized } from "@/api/utils";
import fetchToCurl from "fetch-to-curl";
import { apiBaseUrl } from "@/util/env";
import { useApiCredential } from "@/hooks/useApiCredential";
import { copyText } from "@/util/copyText";
import { WorkflowApiResponse } from "@/routes/workflows/types/workflowTypes";
import { StatusBadge } from "@/components/StatusBadge";
import { CodeEditor } from "@/routes/workflows/components/CodeEditor";
import { statusIsFinalized } from "../types";

function createTaskRequestObject(values: TaskApiResponse) {
return {
Expand Down Expand Up @@ -147,7 +147,7 @@ function TaskDetails() {
const taskIsRunningOrQueued =
task?.status === Status.Running || task?.status === Status.Queued;

const taskHasTerminalState = task && taskIsFinalized(task);
const taskHasTerminalState = task && statusIsFinalized(task);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statusIsFinalized should be called with task.status instead of task.

Suggested change
const taskHasTerminalState = task && statusIsFinalized(task);
const taskHasTerminalState = task && statusIsFinalized(task.status);


const showFailureReason =
task?.status === Status.Failed ||
Expand Down
Loading