refactor(nodes): simplify selection handling
This commit is contained in:
@@ -45,8 +45,7 @@ function handleParentExpand(res: any[], updateItem: any) {
|
||||
}
|
||||
|
||||
function applyChanges(changes: any[], elements: any[]): any[] {
|
||||
// unfortunately we need this hack to handle the setNodes and setEdges function of the
|
||||
// useReactFlow hook.
|
||||
// we need this hack to handle the setNodes and setEdges function of the useReactFlow hook for controlled flows
|
||||
if (changes.some((c) => c.type === 'reset')) {
|
||||
return changes.filter((c) => c.type === 'reset').map((c) => c.item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user