Fixes for record button.

This commit is contained in:
Dermot Duffy
2022-10-02 18:14:37 -07:00
parent fb65c3f99e
commit a5dfe81eab
8 changed files with 68 additions and 29 deletions
+11 -1
View File
@@ -1024,6 +1024,7 @@ export class FrigateCardTimelineCore extends LitElement {
}
const options = this._getOptions();
let createdTimeline = false;
if (
this.timelineDataManager &&
@@ -1056,6 +1057,7 @@ export class FrigateCardTimelineCore extends LitElement {
this.timelineConfig.media,
);
createdTimeline = true;
if (this.mini && groups.length === 1) {
// In a mini timeline, if there's only one group don't bother grouping
// at all.
@@ -1097,7 +1099,15 @@ export class FrigateCardTimelineCore extends LitElement {
}
if (changedProperties.has('view')) {
this._updateTimelineFromView();
if (createdTimeline) {
// If the timeline was just created, give it one frame to draw itself.
// Failure to do so may result in subsequent calls to
// `this._timeline.setwindow()` being entirely ignored. Example case:
// Clicking the timeline control on a recording thumbnail.
window.requestAnimationFrame(this._updateTimelineFromView.bind(this));
} else {
this._updateTimelineFromView();
}
}
}