mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 23:48:04 +08:00
fix(workflow): resolve note node copy/duplicate errors (#27528)
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import {
|
||||
memo,
|
||||
useCallback,
|
||||
useRef,
|
||||
} from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -51,10 +50,6 @@ const NoteNode = ({
|
||||
} = useNodesInteractions()
|
||||
const { handleNodeDataUpdateWithSyncDraft } = useNodeDataUpdate()
|
||||
|
||||
const handleDeleteNode = useCallback(() => {
|
||||
handleNodeDelete(id)
|
||||
}, [id, handleNodeDelete])
|
||||
|
||||
useClickAway(() => {
|
||||
handleNodeDataUpdateWithSyncDraft({ id, data: { selected: false } })
|
||||
}, ref)
|
||||
@ -102,9 +97,9 @@ const NoteNode = ({
|
||||
<NoteEditorToolbar
|
||||
theme={theme}
|
||||
onThemeChange={handleThemeChange}
|
||||
onCopy={handleNodesCopy}
|
||||
onDuplicate={handleNodesDuplicate}
|
||||
onDelete={handleDeleteNode}
|
||||
onCopy={() => handleNodesCopy(id)}
|
||||
onDuplicate={() => handleNodesDuplicate(id)}
|
||||
onDelete={() => handleNodeDelete(id)}
|
||||
showAuthor={data.showAuthor}
|
||||
onShowAuthorChange={handleShowAuthorChange}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user