diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index 5ae08d3..369b2e9 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -21,7 +21,7 @@ class Main extends Component { status: "", faq: false, results: [], - gallery_open: null, + gallery_open: undefined, page: window.location.hash, photos: [], photoIsOpen: false, @@ -60,7 +60,7 @@ class Main extends Component { }) } onHashChange(event){ - this.setState({page: window.location.hash, gallery_open: null}) + this.setState({page: window.location.hash, gallery_open: undefined}) } handleChangeFiles(event) { this.setState({files: [...event.target.files]}) @@ -111,7 +111,7 @@ class Main extends Component { let photos_gallery = []; let photos_carousel = []; if(this.state.gallery_open){ - for (const photo of this.state.photos[this.state.gallery_open]){ + for (const photo of this.state.photos[this.state.gallery_open] || []){ photos_gallery.push({ src: photo.thumbnail, width: photo.original_width,