diff --git a/src/components/surround.ts b/src/components/surround.ts index ec771339..ef4a3995 100644 --- a/src/components/surround.ts +++ b/src/components/surround.ts @@ -8,7 +8,6 @@ import { } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { CameraManager } from '../camera-manager/manager.js'; -import type { DataQuery } from '../camera-manager/types'; import basicBlockStyle from '../scss/basic-block.scss'; import { CardWideConfig, @@ -139,15 +138,12 @@ export class FrigateCardSurround extends LitElement { return null; } if (this.view?.is('live')) { - return getAllDependentCameras(this.cameraManager, this.view.camera); + return this.view.isGrid() + ? this.cameraManager?.getStore().getVisibleCameraIDs() ?? null + : getAllDependentCameras(this.cameraManager, this.view.camera); } if (this.view.isViewerView()) { - return new Set( - this.view.query - ?.getQueries() - ?.map((query: DataQuery) => [...query.cameraIDs]) - .flat(), - ); + return this.view.query?.getQueryCameraIDs() ?? null; } return null; } diff --git a/src/components/timeline-core.ts b/src/components/timeline-core.ts index 8b33f147..bcc4ef3d 100644 --- a/src/components/timeline-core.ts +++ b/src/components/timeline-core.ts @@ -496,8 +496,10 @@ export class FrigateCardTimelineCore extends LitElement { : 'media' : this.view.view; + const selectedCamera = newResults?.getSelectedResult()?.getCameraID(); this.view .evolve({ + ...(selectedCamera && { camera: selectedCamera }), view: desiredView, queryResults: newResults, }) // Whether or not to set the timeline window.