=handle chart loading concurrency issues

This commit is contained in:
Sam 2018-05-16 17:34:45 +10:00
parent 146f634c8f
commit 6ee0eae335

View File

@ -110,9 +110,13 @@ export default Ember.Component.extend(AsyncReport, {
if (this._chart) {
this._chart.destroy();
this._chart = null;
}
loadScript("/javascripts/Chart.min.js").then(() => {
if (this._chart) {
this._chart.destroy();
}
this._chart = new window.Chart(context, this._buildChartConfig(data));
});
});