Try load_lovelace until it succeeds.

This commit is contained in:
2019-12-07 21:11:40 +01:00
parent 605caa906c
commit a38da04024
2 changed files with 43 additions and 60 deletions

View File

@@ -44,7 +44,10 @@ export function load_lovelace() {
if(customElements.get("hui-view")) return true;
const res = document.createElement("partial-panel-resolver");
res.hass = hass();
res.hass = undefined;
while(!res.hass || !res.hass.panels) {
res.hass = hass();
}
res.route = {path: "/lovelace/"};
res._updateRoutes();
try {
@@ -55,5 +58,4 @@ export function load_lovelace() {
}
if(customElements.get("hui-view")) return true;
return false;
}