Skip to content

Commit

Permalink
fix ids
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 4, 2023
1 parent 83a7605 commit 51e5ecb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions askomics/react/src/routes/query/query.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ export default class Query extends Component {
if (preRender) {
// Ugly, but before rendering source and target are IDs and not objects
if (link.source == node.id) {
remote = this.state.nodes.some(rem => {
return (link.target == rem.id )
})
listIds.add(remote.specialNodeGroupId)
}
if (link.target == node.id) {
remote = this.state.nodes.some(rem => {
return (link.source == rem.id )
})
Expand All @@ -136,6 +142,9 @@ export default class Query extends Component {
if (link.source.id == node.id) {
listIds.add(link.target.specialNodeGroupId)
}
if (link.target.id == node.id) {
listIds.add(link.source.specialNodeGroupId)
}
}
})
return Math.max(...listIds)
Expand Down Expand Up @@ -600,7 +609,7 @@ export default class Query extends Component {
})
incrementSpecialNodeGroupId ? specialNodeGroupId += 1 : specialNodeGroupId = specialNodeGroupId
if (incrementSpecialNodeGroupId){
depth = [...node.depth, node.specialNodeGroupId, node.specialNodeGroupId + "_" + incrementSpecialNodeGroupId]
depth = [...node.depth, node.specialNodeId, node.specialNodeId + "_" + incrementSpecialNodeGroupId]
}
}
}
Expand Down Expand Up @@ -649,7 +658,7 @@ export default class Query extends Component {
})
incrementSpecialNodeGroupId ? specialNodeGroupId += 1 : specialNodeGroupId = specialNodeGroupId
if (incrementSpecialNodeGroupId){
depth = [...node.depth, node.specialNodeGroupId, node.specialNodeGroupId + "_" + incrementSpecialNodeGroupId]
depth = [...node.depth, node.specialNodeId, node.specialNodeId + "_" + incrementSpecialNodeGroupId]
}
}
}
Expand Down Expand Up @@ -697,7 +706,7 @@ export default class Query extends Component {
})
incrementSpecialNodeGroupId ? specialNodeGroupId += 1 : specialNodeGroupId = specialNodeGroupId
if (incrementSpecialNodeGroupId){
depth = [...node.depth, node.specialNodeGroupId, node.specialNodeGroupId + "_" + incrementSpecialNodeGroupId]
depth = [...node.depth, node.specialNodeId, node.specialNodeId + "_" + incrementSpecialNodeGroupId]
}
}
})
Expand Down

0 comments on commit 51e5ecb

Please sign in to comment.