diff --git a/src/card.ts b/src/card.ts index 2e919b03..003052d2 100644 --- a/src/card.ts +++ b/src/card.ts @@ -658,7 +658,7 @@ export class FrigateCard extends LitElement { try { entityList = await getAllEntities(this._hass); } catch (e) { - console.error(e, (e as Error).stack); + console.error(e); } const cameras: Map = new Map(); @@ -674,7 +674,7 @@ export class FrigateCard extends LitElement { try { entity = await getExtendedEntity(this._hass, config.camera_entity, cache); } catch (e) { - console.error(e, (e as Error).stack); + console.error(e); } } @@ -704,7 +704,7 @@ export class FrigateCard extends LitElement { cache, ); } catch (e) { - console.error(e, (e as Error).stack); + console.error(e); } if (config.triggers.motion) { @@ -1167,7 +1167,7 @@ export class FrigateCard extends LitElement { try { response = await homeAssistantSignPath(this._hass, path); } catch (e) { - console.error(e, (e as Error).stack); + console.error(e); } if (!response) { @@ -1608,7 +1608,7 @@ export class FrigateCard extends LitElement { (screenfull.isEnabled && screenfull.isFullscreen) || aspectRatioMode == 'unconstrained' || (aspectRatioMode == 'dynamic' && - (this._view?.isMediaView() || this._view?.is('timeline'))) || + (this._view?.isAnyMediaView() || this._view?.is('timeline'))) || this._message != null ); } diff --git a/src/components/elements.ts b/src/components/elements.ts index 10960763..b40f355c 100644 --- a/src/components/elements.ts +++ b/src/components/elements.ts @@ -108,7 +108,7 @@ export class FrigateCardElementsCore extends LitElement { try { element.setConfig(config); } catch (e) { - console.error(e, (e as Error).stack); + console.error(e); throw new FrigateCardError(localize('error.invalid_elements_config')); } return element; diff --git a/src/view.ts b/src/view.ts index 9b10e22c..7759bbcb 100644 --- a/src/view.ts +++ b/src/view.ts @@ -92,10 +92,11 @@ export class View { } /** - * Determine if a view is of a piece of media (i.e. not the gallery). + * Determine if a view is of a piece of media (including the media viewer, + * live view, image view -- anything that can create a MediaShowInfo event). */ - public isMediaView(): boolean { - return this.isViewerView() || this.is('live'); + public isAnyMediaView(): boolean { + return this.isViewerView() || this.is('live') || this.is('image'); } /**