Don't show the timeline if no cameras support it.

This commit is contained in:
Dermot Duffy
2023-02-10 19:32:34 -08:00
parent 163679c650
commit 9cd60172a6
12 changed files with 148 additions and 129 deletions
+1 -6
View File
@@ -39,9 +39,6 @@ export class FrigateCardThumbnailCarousel extends LitElement {
@property({ attribute: false })
public view?: Readonly<View>;
@property({ attribute: false })
public cameras?: Map<string, CameraConfig>;
@property({ attribute: false })
public cameraManager?: CameraManager;
@@ -150,8 +147,7 @@ export class FrigateCardThumbnailCarousel extends LitElement {
*/
protected _renderThumbnail(index: number): TemplateResult | void {
const media = this.view?.queryResults?.getResult(index) ?? null;
const cameraConfig = media ? this.cameras?.get(media.getCameraID()) : null;
if (!media || !cameraConfig || !this.view) {
if (!media || !this.view) {
return;
}
@@ -166,7 +162,6 @@ export class FrigateCardThumbnailCarousel extends LitElement {
.cameraManager=${this.cameraManager}
.hass=${this.hass}
.media=${media}
.cameraConfig=${cameraConfig}
.view=${this.view}
.seek=${seekTarget && media.includesTime(seekTarget) ? seekTarget : undefined}
?details=${!!this.config?.show_details}