From 1707377b021bfc83f6466be9d418cac2877442d9 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Mon, 11 Apr 2022 21:08:27 -0700 Subject: [PATCH] Minor codereview fixes. --- src/components/timeline.ts | 6 ++++++ src/components/viewer.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/timeline.ts b/src/components/timeline.ts index d6639459..ebce82ae 100644 --- a/src/components/timeline.ts +++ b/src/components/timeline.ts @@ -849,6 +849,12 @@ export class FrigateCardTimelineCore extends LitElement { } } + /** + * Generate the context for timeline views. + * @param addWindow Whether or not to include the timeline window. If `false` + * the window is preserved if it is already in the context. + * @returns The TimelineViewContext object. + */ protected _generateViewContext(addWindow: boolean): TimelineViewContext { const currentContext = this.view?.context as TimelineViewContext | undefined; const newContext: TimelineViewContext = {}; diff --git a/src/components/viewer.ts b/src/components/viewer.ts index d01f544c..ba4e83c7 100644 --- a/src/components/viewer.ts +++ b/src/components/viewer.ts @@ -256,7 +256,7 @@ export class FrigateCardViewerCarousel extends FrigateCardMediaCarousel { protected _getOptions(): EmblaOptionsType { return { // Start the carousel on the selected child number. - startIndex: this._getSlideForChild(this.view?.childIndex) ?? undefined, + startIndex: this._getSlideForChild(this.view?.childIndex) ?? 0, draggable: this.viewerConfig?.draggable, }; }