Don't try load_lovelace until it succeeds.

This commit is contained in:
Thomas Lovén 2019-12-08 20:26:03 +01:00
parent a38da04024
commit 8790289006

View File

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