Reset the timeline data source when the cameraIDs change.

This commit is contained in:
Dermot Duffy
2023-01-30 20:30:26 -08:00
parent f9f2a494c6
commit d1755eedcb
2 changed files with 10 additions and 19 deletions
+2 -11
View File
@@ -3,9 +3,9 @@ import add from 'date-fns/add';
import sub from 'date-fns/sub';
import { DataSet } from 'vis-data';
import { IdType, TimelineItem, TimelineWindow } from 'vis-timeline/esnext';
import { ClipsOrSnapshotsOrAll, RecordingSegment } from '../types';
import { ClipsOrSnapshotsOrAll } from '../types';
import { CameraManager } from '../camera-manager/manager';
import { EventQuery } from '../camera-manager/types';
import { EventQuery, RecordingSegment } from '../camera-manager/types';
import { capEndDate, convertRangeToCacheFriendlyTimes } from '../camera-manager/util';
import { ViewMedia } from '../view/media';
import {
@@ -64,15 +64,6 @@ export class TimelineDataSource {
return this._dataset;
}
public clearEvents(): void {
this._eventRanges.clear();
this._dataset.remove(
this._dataset.get({
filter: (item) => item.type !== 'background',
}),
);
}
public rewriteEvent(id: IdType): void {
// Hack: For timeline uses of the event dataset clustering may not update
// unless the dataset changes, artifically update the dataset to ensure the