Skip to content

Commit

Permalink
MM-381 Fix infinite render loop with diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
jhanninen committed May 10, 2022
1 parent 25ef4a9 commit 062d3e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/stopPoster/stopPoster.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ class StopPoster extends Component {
adsPhase: false,
diagramOptions: defaultDiagramOptions,
};
}

componentWillMount() {
renderQueue.add(this);
}

Expand Down Expand Up @@ -193,6 +190,11 @@ class StopPoster extends Component {
// TODO: This is kind of dirty fix. Binarysearch to get acceptable
// height for routetree.
const { diagramOptions } = this.state;

if (diagramOptions.heightValues.length === 0) {
this.setState({ hasDiagram: false });
return;
}
diagramOptions.binarySearching = true;
diagramOptions.middleHeightValue =
diagramOptions.heightValues[Math.floor(diagramOptions.heightValues.length / 2)];
Expand Down

0 comments on commit 062d3e8

Please sign in to comment.