Compare commits

...
2 changed files with 8 additions and 3 deletions

No files matched your search

+1 -1
View File
@@ -205,7 +205,7 @@ window.hassConnection.then(({ conn }) => {
// Ignore it, it is handled by Lovelace panel.
});
}
if (location.pathname === "/" || location.pathname.startsWith("/lovelace/")) {
if (location.pathname === "/" || dashboardUrlPath) {
preloadWindow.llResProm = fetchResources(conn);
}
});
+7 -2
View File
@@ -322,8 +322,13 @@ export class LovelacePanel extends LitElement {
}
if (!resourcesLoaded) {
resourcesLoaded = true;
(preloadWindow.llResProm || fetchResources(this.hass!.connection)).then(
(resources) => loadLovelaceResources(resources, this.hass!)
const fetchDashboardResources = () =>
fetchResources(this.hass!.connection);
const resourcesProm =
preloadWindow.llResProm?.catch(fetchDashboardResources) ??
fetchDashboardResources();
resourcesProm.then((resources) =>
loadLovelaceResources(resources, this.hass!)
);
}
// Refreshing a YAML config can trigger an update event. We will ignore