fix(workflow): resolve note node copy/duplicate errors (#27528)
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
@@ -1445,6 +1445,7 @@ export const useNodesInteractions = () => {
|
||||
// If no nodeId is provided, fall back to the current behavior
|
||||
const bundledNodes = nodes.filter((node) => {
|
||||
if (!node.data._isBundled) return false
|
||||
if (node.type === CUSTOM_NOTE_NODE) return true
|
||||
const { metaData } = nodesMetaDataMap![node.data.type as BlockEnum]
|
||||
if (metaData.isSingleton) return false
|
||||
return !node.data.isInIteration && !node.data.isInLoop
|
||||
@@ -1457,6 +1458,7 @@ export const useNodesInteractions = () => {
|
||||
|
||||
const selectedNode = nodes.find((node) => {
|
||||
if (!node.data.selected) return false
|
||||
if (node.type === CUSTOM_NOTE_NODE) return true
|
||||
const { metaData } = nodesMetaDataMap![node.data.type as BlockEnum]
|
||||
return !metaData.isSingleton
|
||||
})
|
||||
@@ -1495,7 +1497,7 @@ export const useNodesInteractions = () => {
|
||||
= generateNewNode({
|
||||
type: nodeToPaste.type,
|
||||
data: {
|
||||
...nodesMetaDataMap![nodeType].defaultValue,
|
||||
...(nodeToPaste.type !== CUSTOM_NOTE_NODE && nodesMetaDataMap![nodeType].defaultValue),
|
||||
...nodeToPaste.data,
|
||||
selected: false,
|
||||
_isBundled: false,
|
||||
|
||||
Reference in New Issue
Block a user