Skip to content

Commit

Permalink
fix marking related nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaLysiuk committed May 10, 2024
1 parent 7535584 commit d87adb6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/editor/src/state/containers/trees/index.ts
Expand Up @@ -186,7 +186,12 @@ const useTreesStateContainer = createContainer(() => {
};

const relatedToSelectedTypes = (activeNode?: ParserField) => {
const parents = activeNode?.args.flatMap((ana) => ana.args);
const parents = allNodes.nodes.filter((node) =>
activeNode?.args
.flatMap((ana) => ana.args)
.map((ana) => getTypeName(ana.type.fieldType))
.includes(node.name)
);
const inputs = allNodes.nodes.filter((an) =>
an.args.find(
(ana) =>
Expand Down Expand Up @@ -230,7 +235,7 @@ const useTreesStateContainer = createContainer(() => {
);

const notBaseTypes = argsTypeRelated
.concat(parents || [])
.concat(parents)
.concat(inputs)
.concat(interfacesRelatedToActiveNode)
.concat(nodesRelatedToActiveInterface)
Expand Down

0 comments on commit d87adb6

Please sign in to comment.