Quick fix for lovelace resources not loaded (#18430)

This commit is contained in:
Paul Bottein 2023-10-26 15:37:31 +02:00 committed by GitHub
parent cf0fde0f3c
commit d491d8f5ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -11,7 +11,8 @@ export const loadLovelaceResources = (
hass: HomeAssistant
) => {
// Don't load ressources on safe mode
if (hass.config.safe_mode) {
// Sometimes, hass.config is null but it should not.
if (hass.config?.safe_mode) {
return;
}
resources.forEach((resource) => {

View File

@ -229,9 +229,9 @@ export class LovelacePanel extends LitElement {
}
if (!resourcesLoaded) {
resourcesLoaded = true;
const resources = await (preloadWindow.llResProm ||
fetchResources(this.hass!.connection));
loadLovelaceResources(resources, this.hass!);
(preloadWindow.llResProm || fetchResources(this.hass!.connection)).then(
(resources) => loadLovelaceResources(resources, this.hass!)
);
}
if (this.urlPath !== null || !confProm) {