From a496e5ad2ce5f2052d03877d947e5465029f13f8 Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Wed, 8 May 2024 13:32:20 +0200 Subject: [PATCH] maybe fix --- frontend/src/scripts/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index d61f083..9418640 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -85,7 +85,7 @@ class Main extends Component { }) } if (this.state.photos.length > 3){ - for(let i=this.state.currentImage - 1; i<=this.state.currentImage + 1; i++){ + for(let i=this.state.currentImage-1; i<=this.state.currentImage+1; i++){ let j = i; if(j < 0){ j += this.state.photos.length; @@ -94,12 +94,15 @@ class Main extends Component { } } + let carousel = this.onViewChange(v)}}/> + carousel.setState({currentIndex: 1}) + return (
{this.state.photoIsOpen && - this.onViewChange(v)}}/> + {carousel} }