Skip to content

Commit

Permalink
Merge pull request #4837 from hashicorp/b-ui-d3-race-condition
Browse files Browse the repository at this point in the history
UI: Guard against the line chart element already being destroyed
  • Loading branch information
DingoEatingFuzz authored Nov 7, 2018
2 parents e869d1f + 5aef27c commit 31e21ae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ui/app/components/line-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,11 @@ export default Component.extend(WindowResizable, {
},

mountD3Elements() {
d3.select(this.element.querySelector('.x-axis')).call(this.get('xAxis'));
d3.select(this.element.querySelector('.y-axis')).call(this.get('yAxis'));
d3.select(this.element.querySelector('.y-gridlines')).call(this.get('yGridlines'));
if (!this.get('isDestroyed') && !this.get('isDestroying')) {
d3.select(this.element.querySelector('.x-axis')).call(this.get('xAxis'));
d3.select(this.element.querySelector('.y-axis')).call(this.get('yAxis'));
d3.select(this.element.querySelector('.y-gridlines')).call(this.get('yGridlines'));
}
},

windowResizeHandler() {
Expand Down

0 comments on commit 31e21ae

Please sign in to comment.