mirror of
https://github.com/simon987/music-graph-ui.git
synced 2025-04-19 18:16:41 +00:00
Don't mark as expanded if no related nodes
This commit is contained in:
parent
0a1868c4e3
commit
bb31e865a4
@ -183,8 +183,10 @@ export function MusicGraph(data) {
|
|||||||
fn: (d) => {
|
fn: (d) => {
|
||||||
this.api.getRelatedByMbid(d.mbid)
|
this.api.getRelatedByMbid(d.mbid)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
if (data.newNodes.length > 0) {
|
||||||
this.expandedNodes.add(d.id)
|
this.expandedNodes.add(d.id)
|
||||||
this.addNodes(data.newNodes, data.relations, d.id)
|
this.addNodes(data.newNodes, data.relations, d.id)
|
||||||
|
}
|
||||||
d.relatedExpanded = true
|
d.relatedExpanded = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user