Recalculate timeline cameras when display mode changes.
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
// TODO: Live non-grid -> live grid -> timeline is different from when the timeline is dragged.
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CSSResultGroup,
|
CSSResultGroup,
|
||||||
html,
|
html,
|
||||||
|
|||||||
@@ -113,12 +113,14 @@ export class FrigateCardSurround extends LitElement {
|
|||||||
import('./timeline.js');
|
import('./timeline.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only reset the timeline cameraIDs when the media materially changes (and
|
// Only reset the timeline cameraIDs when the media or display mode
|
||||||
// not on every view change, since the view will change frequently when the
|
// materially changes (and not on every view change, since the view will
|
||||||
// user is scrubbing video).
|
// change frequently when the user is scrubbing video).
|
||||||
|
const oldView = changedProperties.get('view');
|
||||||
if (
|
if (
|
||||||
changedProperties.has('view') &&
|
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;
|
this._cameraIDsForTimeline = this._getCameraIDsForTimeline() ?? undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1221,8 +1221,6 @@ export class FrigateCardTimelineCore extends LitElement {
|
|||||||
createdTimeline = true;
|
createdTimeline = true;
|
||||||
const noGroups = this.mini && groups.length === 1;
|
const noGroups = this.mini && groups.length === 1;
|
||||||
if (noGroups) {
|
if (noGroups) {
|
||||||
// In a mini timeline, if there's only one group don't bother grouping
|
|
||||||
// at all.
|
|
||||||
this._timeline = new Timeline(
|
this._timeline = new Timeline(
|
||||||
this._refTimeline.value,
|
this._refTimeline.value,
|
||||||
this._timelineSource.dataset,
|
this._timelineSource.dataset,
|
||||||
|
|||||||
Reference in New Issue
Block a user