fix: copy to clipboard

This commit is contained in:
naiba committed 2024-11-30 17:08:47 +08:00
1 parent 31c0e4c485
commit a3c9fcec73
6 files changed
+42 -7

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ import useWebSocket from "react-use-websocket"
import { toast } from "sonner"
import { ColumnDef } from "@tanstack/react-table"
import { Folder, File } from "lucide-react"
import { fm, formatPath, fmWorker as worker } from "@/lib/utils"
import { copyToClipboard, fm, formatPath, fmWorker as worker } from "@/lib/utils"
import {
AlertDialog,
AlertDialogContent,
@@ -293,7 +293,7 @@ const FMComponent: React.FC<FMProps & JSX.IntrinsicElements["div"]> = ({ wsUrl,
<DropdownMenuItem onClick={listFile}>{t('Refresh')}</DropdownMenuItem>
<DropdownMenuItem onClick={
async () => {
await navigator.clipboard.writeText(formatPath(currentPath));
await copyToClipboard(formatPath(currentPath));
}
}>{t("CopyPath")}</DropdownMenuItem>
<AlertDialogTrigger asChild>