make frontend more resilient to a broken graph
This commit is contained in:
parent
dfaf15fb51
commit
f4044a4cd7
|
@ -64,9 +64,12 @@ class GraphImpl extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
const sigma = this.sigmaComponent.current.sigma;
|
const sigma = this.sigmaComponent && this.sigmaComponent.current.sigma;
|
||||||
sigma.graph.nodes().map(this.colorNodes);
|
// Check if sigma exists s.t. nothing breaks if the graph didn't load (for whatever reason)
|
||||||
sigma.refresh();
|
if (sigma) {
|
||||||
|
sigma.graph.nodes().map(this.colorNodes);
|
||||||
|
sigma.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickNode = (e) => {
|
onClickNode = (e) => {
|
||||||
|
|
Loading…
Reference in a new issue