1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-02 00:27:49 +01:00

Await energy translation fragment before generating dashboard strategy (#51327)

This commit is contained in:
Petar Petrov
2026-04-01 10:41:27 +02:00
committed by Bram Kragten
parent fba430d507
commit aaf8fa199f

View File

@@ -39,8 +39,7 @@ class PanelEnergy extends LitElement {
super.willUpdate(changedProps);
// Initial setup
if (!this.hasUpdated) {
this.hass.loadFragmentTranslation("lovelace");
this._loadConfig();
this._setup();
return;
}
@@ -54,6 +53,14 @@ class PanelEnergy extends LitElement {
}
}
private async _setup() {
await Promise.all([
this.hass.loadFragmentTranslation("lovelace"),
this.hass.loadFragmentTranslation("energy"),
]);
this._loadConfig();
}
private async _loadConfig() {
try {
this._error = undefined;