From 51f38226aceb25b32c0304fb9c9bd0dcc3dddd72 Mon Sep 17 00:00:00 2001 From: MT-Fire <798521692@qq.com> Date: Sun, 29 Mar 2026 00:12:45 +0800 Subject: [PATCH] =?UTF-8?q?chore(frontend):=20=E5=90=8C=E6=AD=A5=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8C=BA=E5=89=AA=E8=B4=B4=E6=9D=BF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/workspace/copy-button.tsx | 3 +-- frontend/src/components/workspace/recent-chat-list.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/workspace/copy-button.tsx b/frontend/src/components/workspace/copy-button.tsx index b279a56b..13d331b5 100644 --- a/frontend/src/components/workspace/copy-button.tsx +++ b/frontend/src/components/workspace/copy-button.tsx @@ -3,7 +3,6 @@ import { useCallback, useState, type ComponentProps } from "react"; import { Button } from "@/components/ui/button"; import { useI18n } from "@/core/i18n/hooks"; -import { copyToClipboard } from "@/lib/utils"; import { Tooltip } from "./tooltip"; @@ -16,7 +15,7 @@ export function CopyButton({ const { t } = useI18n(); const [copied, setCopied] = useState(false); const handleCopy = useCallback(() => { - void copyToClipboard(clipboardData); + void navigator.clipboard.writeText(clipboardData); setCopied(true); setTimeout(() => setCopied(false), 2000); }, [clipboardData]); diff --git a/frontend/src/components/workspace/recent-chat-list.tsx b/frontend/src/components/workspace/recent-chat-list.tsx index 90deff47..09f0b343 100644 --- a/frontend/src/components/workspace/recent-chat-list.tsx +++ b/frontend/src/components/workspace/recent-chat-list.tsx @@ -56,7 +56,6 @@ import { import type { AgentThread, AgentThreadState } from "@/core/threads/types"; import { pathOfThread, titleOfThread } from "@/core/threads/utils"; import { env } from "@/env"; -import { copyToClipboard } from "@/lib/utils"; export function RecentChatList() { const { t } = useI18n(); @@ -120,7 +119,7 @@ export function RecentChatList() { const baseUrl = isLocalhost ? VERCEL_URL : window.location.origin; const shareUrl = `${baseUrl}/workspace/chats/${threadId}`; try { - await copyToClipboard(shareUrl); + await navigator.clipboard.writeText(shareUrl); toast.success(t.clipboard.linkCopied); } catch { toast.error(t.clipboard.failedToCopyToClipboard);