Use query type instead of view.

This commit is contained in:
Dermot Duffy
2023-01-24 19:36:54 -08:00
parent 093925cb40
commit 66ee65f8cc
4 changed files with 20 additions and 53 deletions
+3 -3
View File
@@ -496,7 +496,7 @@ export class FrigateCardTimelineCore extends LitElement {
} else if (
properties.item &&
properties.what === 'item' &&
this.view.is('recording')
this.view.query?.areRecordingQueries()
) {
viewPromise = (async (): Promise<View | null> => {
if (!properties.item || !this.dataManager || !this.hass) {
@@ -606,7 +606,7 @@ export class FrigateCardTimelineCore extends LitElement {
// Don't show event thumbnails if the user is looking at recordings,
// as the recording "hours" are the media, not the event
// clips/snapshots.
if (this._timeline && this.view && !this.view?.is('recording')) {
if (this._timeline && this.view && !this.view.query?.areRecordingQueries()) {
(
await this._createViewWithEventMediaQuery(
this._createEventMediaQuerys({ window: prefetchedWindow }),
@@ -967,7 +967,7 @@ export class FrigateCardTimelineCore extends LitElement {
if (
!this.mini &&
!this.view.is('recording') &&
!this.view.query?.areRecordingQueries() &&
freshMediaQuery &&
!this._alreadyHasAcceptableMediaQuery(freshMediaQuery)
) {