Skip to content

Commit

Permalink
change in setSelected
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaLysiuk committed Jan 31, 2024
1 parent e8ae07b commit 7ecfd93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/editor/src/state/containers/trees/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ const useTreesStateContainer = createContainer(() => {
.map((a) => a.name);
const nodesRelatedToActiveInterface =
activeNode &&
activeNode.data.type === TypeDefinition.InterfaceTypeDefinition
activeNode.data.type === TypeDefinition.InterfaceTypeDefinition
? allNodes.nodes
.filter((node) => node.interfaces.includes(activeNode.name))
.map((a) => a.name)
.filter((node) => node.interfaces.includes(activeNode.name))
.map((a) => a.name)
: [];
const notBaseTypes = activeNode?.args
.map((a) => getTypeName(a.type.fieldType))
Expand Down Expand Up @@ -237,12 +237,12 @@ const useTreesStateContainer = createContainer(() => {
const setSelectedNodeId = useCallback(
(_selectedNodeId?: SelectedNodeId) => {
const nodeId = _selectedNodeId?.value?.id;
DOMEvents.selectNode.trigger(nodeId);
if (
nodeId !== selectedNodeId?.value?.id ||
_selectedNodeId?.justCreated !== selectedNodeId?.justCreated
) {
setTimeout(() => {
DOMEvents.selectNode.trigger(nodeId);
return _setSelectedNodeId(_selectedNodeId);
}, 250);
}
Expand Down

0 comments on commit 7ecfd93

Please sign in to comment.