Merge pull request #4837 from hashicorp/b-ui-d3-race-condition

UI: Guard against the line chart element already being destroyed
This commit is contained in:
Michael Lange 2018-11-06 16:28:45 -08:00 committed by GitHub
commit 4e924c13b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -325,9 +325,11 @@ export default Component.extend(WindowResizable, {
}, },
mountD3Elements() { mountD3Elements() {
if (!this.get('isDestroyed') && !this.get('isDestroying')) {
d3.select(this.element.querySelector('.x-axis')).call(this.get('xAxis')); 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-axis')).call(this.get('yAxis'));
d3.select(this.element.querySelector('.y-gridlines')).call(this.get('yGridlines')); d3.select(this.element.querySelector('.y-gridlines')).call(this.get('yGridlines'));
}
}, },
windowResizeHandler() { windowResizeHandler() {