Don't mark as expanded if no related nodes

This commit is contained in:
simon 2019-05-25 16:34:37 -04:00
parent 0a1868c4e3
commit bb31e865a4

View File

@ -183,8 +183,10 @@ export function MusicGraph(data) {
fn: (d) => {
this.api.getRelatedByMbid(d.mbid)
.then(data => {
this.expandedNodes.add(d.id)
this.addNodes(data.newNodes, data.relations, d.id)
if (data.newNodes.length > 0) {
this.expandedNodes.add(d.id)
this.addNodes(data.newNodes, data.relations, d.id)
}
d.relatedExpanded = true
})
}