mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix chart not able to setup because canvas in use (#18018)
* Fix chart not able to setup because canvas in use * Update ha-chart-base.ts
This commit is contained in:
parent
5aaf0cd579
commit
2a8d98307e
@ -53,13 +53,14 @@ export class HaChartBase extends LitElement {
|
||||
@state() private _hiddenDatasets: Set<number> = new Set();
|
||||
|
||||
public disconnectedCallback() {
|
||||
this._releaseCanvas();
|
||||
super.disconnectedCallback();
|
||||
this._releaseCanvas();
|
||||
}
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
if (this.hasUpdated) {
|
||||
this._releaseCanvas();
|
||||
this._setupChart();
|
||||
}
|
||||
}
|
||||
@ -110,7 +111,7 @@ export class HaChartBase extends LitElement {
|
||||
return;
|
||||
}
|
||||
if (changedProps.has("plugins") || changedProps.has("chartType")) {
|
||||
this.chart.destroy();
|
||||
this._releaseCanvas();
|
||||
this._setupChart();
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user