Skip to content

Commit

Permalink
Show save changes button as disabled when not dirty instead of not sh… (
Browse files Browse the repository at this point in the history
  • Loading branch information
msalihaltun committed Jun 13, 2024
1 parent 4bb7403 commit 1d46a4d
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions skyvern-frontend/src/routes/tasks/create/SavedTaskForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,21 +480,18 @@ function SavedTaskForm({ initialValues }: Props) {
>
Copy cURL
</Button>
{isDirty && (
<Button
type="submit"
name="save"
value="save"
variant="secondary"
disabled={saveTaskMutation.isPending}
>
{saveTaskMutation.isPending && (
<ReloadIcon className="mr-2 h-4 w-4 animate-spin" />
)}
Save Changes
</Button>
)}

<Button
type="submit"
name="save"
value="save"
variant="secondary"
disabled={saveTaskMutation.isPending || !isDirty}
>
{saveTaskMutation.isPending && (
<ReloadIcon className="mr-2 h-4 w-4 animate-spin" />
)}
Save Changes
</Button>
<Button
type="submit"
name="create"
Expand Down

0 comments on commit 1d46a4d

Please sign in to comment.