Recalculate timeline cameras when display mode changes.

This commit is contained in:
Dermot Duffy
2023-09-04 19:51:15 -07:00
parent d425457781
commit 07bc6391ec
3 changed files with 6 additions and 8 deletions
-2
View File
@@ -1,5 +1,3 @@
// TODO: Live non-grid -> live grid -> timeline is different from when the timeline is dragged.
import {
CSSResultGroup,
html,
+6 -4
View File
@@ -113,12 +113,14 @@ export class FrigateCardSurround extends LitElement {
import('./timeline.js');
}
// Only reset the timeline cameraIDs when the media materially changes (and
// not on every view change, since the view will change frequently when the
// user is scrubbing video).
// Only reset the timeline cameraIDs when the media or display mode
// materially changes (and not on every view change, since the view will
// change frequently when the user is scrubbing video).
const oldView = changedProperties.get('view');
if (
changedProperties.has('view') &&
View.isMajorMediaChange(changedProperties.get('view'), this.view)
(View.isMajorMediaChange(oldView, this.view) ||
oldView.displayMode !== this.view?.displayMode)
) {
this._cameraIDsForTimeline = this._getCameraIDsForTimeline() ?? undefined;
}
-2
View File
@@ -1221,8 +1221,6 @@ export class FrigateCardTimelineCore extends LitElement {
createdTimeline = true;
const noGroups = this.mini && groups.length === 1;
if (noGroups) {
// In a mini timeline, if there's only one group don't bother grouping
// at all.
this._timeline = new Timeline(
this._refTimeline.value,
this._timelineSource.dataset,