maybe fix

This commit is contained in:
Martin Quarda 2024-05-08 13:38:20 +02:00
parent a496e5ad2c
commit d5620ae8b2

View File

@ -49,6 +49,7 @@ class Main extends Component {
new_index += this.state.photos.length
}
this.setState({currentImage: new_index})
this.carousel && this.carousel.setState({currentIndex: 1})
}
onSubmit(event){
event.preventDefault();
@ -94,8 +95,7 @@ class Main extends Component {
}
}
let carousel = <Carousel views={photos_carousel} currentIndex={0} trackProps={{onViewChange: (v) => this.onViewChange(v)}}/>
carousel.setState({currentIndex: 1})
this.carousel = this.state.photoIsOpen && <Carousel views={photos_carousel} currentIndex={1} trackProps={{onViewChange: (v) => this.onViewChange(v)}}/>
return (
<div>