fix(canvas): 节点复制 - 修复内部粘贴和批量状态残留 (#60)

Co-authored-by: Danborad <Danborad@users.noreply.github.com>
This commit is contained in:
DanboradandDanborad authored and GitHub committed 2026-08-01 15:38:15 +08:00
1 parent 86549843fd
commit 968e70e45d
10 files changed
+129 -31

No files matched your search

+4 -1
View File
@@ -366,7 +366,10 @@ export function useCanvasUpload({
}, [message, nodesRef, persistMediaNode, selectInsertedNode, setNodes, startUploadStatus]);
const pasteSystemClipboard = useCallback(async (position?: Position, clipboardEvent?: ClipboardEvent | null) => {
const isNodeMarker = (value: string) => value.trim().startsWith("open-ai-canvas-nodes:");
const isNodeMarker = (value: string) => {
const trimmed = value.trim();
return trimmed.startsWith("open-ai-canvas-nodes:") || trimmed.startsWith("open-ai-canvas-nodes-json:");
};
const pasteImageFile = async (file: File) => {
const selected = nodesRef.current.filter((node) => selectedNodeIdsRef.current.has(node.id));
if (selected.length === 1 && selected[0].type === CanvasNodeType.Image) {