Merge pull request #1024 from dermotduffy/card-crashing-for-felipe
Fix initialization logic to avoid infinite loop
This commit is contained in:
+8
-5
@@ -1192,14 +1192,17 @@ class FrigateCard extends LitElement {
|
|||||||
.initializeMultipleIfNecessary({
|
.initializeMultipleIfNecessary({
|
||||||
// Caution: Ensure nothing in this set of initializers requires
|
// Caution: Ensure nothing in this set of initializers requires
|
||||||
// languages since they will not yet have been initialized.
|
// languages since they will not yet have been initialized.
|
||||||
[InitializationAspect.LANGUAGES]: async () => loadLanguages(hass),
|
[InitializationAspect.LANGUAGES]: async () => await loadLanguages(hass),
|
||||||
[InitializationAspect.SIDE_LOAD_ELEMENTS]: async () =>
|
[InitializationAspect.SIDE_LOAD_ELEMENTS]: async () =>
|
||||||
sideLoadHomeAssistantElements,
|
await sideLoadHomeAssistantElements(),
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then((initialized) => {
|
||||||
|
if (!initialized) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return this._initializer.initializeIfNecessary(
|
return this._initializer.initializeIfNecessary(
|
||||||
InitializationAspect.CAMERAS,
|
InitializationAspect.CAMERAS,
|
||||||
async () => this._initializeCameras(hass, config, cardWideConfig),
|
async () => await this._initializeCameras(hass, config, cardWideConfig),
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.then((initialized) => {
|
.then((initialized) => {
|
||||||
@@ -1228,7 +1231,7 @@ class FrigateCard extends LitElement {
|
|||||||
.initializeMultipleIfNecessary({
|
.initializeMultipleIfNecessary({
|
||||||
...(config.menu.buttons.media_player.enabled && {
|
...(config.menu.buttons.media_player.enabled && {
|
||||||
[InitializationAspect.MEDIA_PLAYERS]: async () =>
|
[InitializationAspect.MEDIA_PLAYERS]: async () =>
|
||||||
this._initializeMediaPlayers(hass),
|
await this._initializeMediaPlayers(hass),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
.then((initialized) => {
|
.then((initialized) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user