Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored and ogabrielluiz committed Oct 9, 2024
1 parent ceaeb59 commit 185b18e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
track("Component Connection Deleted");
}
if (lastSelection.nodes?.length) {
lastSelection.nodes.forEach(n => {
lastSelection.nodes.forEach((n) => {
track("Component Deleted", { componentType: n.data.type });
})
});
}
deleteNode(lastSelection.nodes.map((node) => node.id));
deleteEdge(lastSelection.edges.map((edge) => edge.id));
Expand Down
17 changes: 9 additions & 8 deletions src/frontend/src/stores/flowStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,23 +274,24 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
deletedNode: Node | null;
}>(
(acc, node) => {
const isMatch = typeof nodeId === "string"
? node.id === nodeId
: nodeId.includes(node.id);

const isMatch =
typeof nodeId === "string"
? node.id === nodeId
: nodeId.includes(node.id);

if (isMatch) {
acc.deletedNode = node;
} else {
acc.filteredNodes.push(node);
}

return acc;
},
{ filteredNodes: [], deletedNode: null }
{ filteredNodes: [], deletedNode: null },
);

get().setNodes(filteredNodes);

if (deletedNode) {
track("Component Deleted", { componentType: deletedNode.data.type });
}
Expand Down

0 comments on commit 185b18e

Please sign in to comment.