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} }