From 29f02990f1e7467e536f151c9e86821c1b0c9e98 Mon Sep 17 00:00:00 2001 From: Giulia Ghisini Date: Mon, 6 Nov 2023 10:05:17 +0100 Subject: [PATCH] fix: GalleryPreview --- .../ItaliaTheme/GalleryPreview/GalleryPreview.jsx | 2 +- src/components/ItaliaTheme/View/ViewUtils.jsx | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/ItaliaTheme/GalleryPreview/GalleryPreview.jsx b/src/components/ItaliaTheme/GalleryPreview/GalleryPreview.jsx index 3f7a2a063..954b42695 100644 --- a/src/components/ItaliaTheme/GalleryPreview/GalleryPreview.jsx +++ b/src/components/ItaliaTheme/GalleryPreview/GalleryPreview.jsx @@ -35,7 +35,7 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => { const image = items[viewIndex]; let checkUrlImage = image?.image_field - ? image.image_scales?.[image.image_field]?.[0]?.scales?.larger?.download + ? image?.image_scales?.[image?.image_field]?.[0]?.scales?.larger?.download : image?.image?.scales?.larger?.download || image?.image_scales?.image[0]?.scales?.larger?.download; diff --git a/src/components/ItaliaTheme/View/ViewUtils.jsx b/src/components/ItaliaTheme/View/ViewUtils.jsx index ae4d15ce8..f7085304b 100644 --- a/src/components/ItaliaTheme/View/ViewUtils.jsx +++ b/src/components/ItaliaTheme/View/ViewUtils.jsx @@ -53,14 +53,6 @@ export const useSideMenu = (content, documentBody) => { }, [content.description, content.title, documentBody]); //observer is needed for loadable blocks like listing and rss, if you want to use their title's for SideMenu - // useEffect(() => { - // const obs = updateSideMenuOnLoadingBlocks - // ? new MutationObserver((mutationList) => { - // setSideMenuElements(documentBody.current); - // }) - // : null; - // setObserver(obs); - // }, [setObserver]); useEffect(() => { if (!updateSideMenuOnLoadingBlocks) return;