Change text copy to use fallback (#811)

This commit is contained in:
Salih Altun
2024-09-11 20:01:45 +03:00
committed by GitHub
parent dddfaf98e2
commit 267c859d3b
5 changed files with 51 additions and 18 deletions

View File

@@ -49,6 +49,7 @@ import {
import { OrganizationApiResponse } from "@/api/types";
import { MAX_STEPS_DEFAULT } from "../constants";
import { Skeleton } from "@/components/ui/skeleton";
import { copyText } from "@/util/copyText";
const savedTaskFormSchema = z
.object({
@@ -629,10 +630,11 @@ function SavedTaskForm({ initialValues }: Props) {
"x-api-key": apiCredential ?? "<your-api-key>",
},
});
await navigator.clipboard.writeText(curl);
toast({
title: "Copied cURL",
description: "cURL copied to clipboard",
copyText(curl).then(() => {
toast({
title: "Copied cURL",
description: "cURL copied to clipboard",
});
});
}}
>