From d5620ae8b26f86382885974bb74555802b1a648a Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Wed, 8 May 2024 13:38:20 +0200 Subject: [PATCH] maybe fix --- frontend/src/scripts/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index 9418640..93b8f23 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -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 = this.onViewChange(v)}}/> - carousel.setState({currentIndex: 1}) + this.carousel = this.state.photoIsOpen && this.onViewChange(v)}}/> return (