From 71d9e867b387bf05f124b5190ec588a1683abbd9 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sun, 26 Jun 2022 13:32:21 -0700 Subject: [PATCH 1/2] Fix Safari live camera loop bug --- src/components/media-carousel.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/media-carousel.ts b/src/components/media-carousel.ts index c585b553..46735538 100644 --- a/src/components/media-carousel.ts +++ b/src/components/media-carousel.ts @@ -126,7 +126,9 @@ export class FrigateCardMediaCarousel extends FrigateCardCarousel { */ const reInit = (): void => { - this._carousel?.reInit(); + // Safari appears to not loop the carousel unless the options are passed + // back in during re-initialization. + this._carousel?.reInit(this._getOptions()); }; if (entries.some((entry) => entry.isIntersecting)) { @@ -226,8 +228,10 @@ export class FrigateCardMediaCarousel extends FrigateCardCarousel { */ protected _nextPreviousHandler(direction: 'previous' | 'next'): void { if (direction === 'previous') { + console.info("scrolling previous", this._carousel?.canScrollPrev()); this._carousel?.scrollPrev(this._getTransitionEffect() === 'none'); } else if (direction === 'next') { + console.info("scrolling next"); this._carousel?.scrollNext(this._getTransitionEffect() === 'none'); } } From 6d80ff302c7c61073eecd064fdad07b30c43a8a9 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sun, 26 Jun 2022 13:34:08 -0700 Subject: [PATCH 2/2] Remove superfluous logging. --- src/components/media-carousel.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/media-carousel.ts b/src/components/media-carousel.ts index 46735538..2b654071 100644 --- a/src/components/media-carousel.ts +++ b/src/components/media-carousel.ts @@ -228,10 +228,8 @@ export class FrigateCardMediaCarousel extends FrigateCardCarousel { */ protected _nextPreviousHandler(direction: 'previous' | 'next'): void { if (direction === 'previous') { - console.info("scrolling previous", this._carousel?.canScrollPrev()); this._carousel?.scrollPrev(this._getTransitionEffect() === 'none'); } else if (direction === 'next') { - console.info("scrolling next"); this._carousel?.scrollNext(this._getTransitionEffect() === 'none'); } }