Merged in fix/SW-2831-image-gallery-history (pull request #2155)

fix(SW-2831): checking isOpen before rendering Lightbox component to avoid spamming the window history

* fix(SW-2831): checking isOpen before rendering Lightbox component to avoid spamming the window history


Approved-by: Linus Flood
This commit is contained in:
Erik Tiekstra
2025-05-20 07:38:13 +00:00
committed by Linus Flood
parent f4ef5a342f
commit f60d07fd9e
5 changed files with 71 additions and 76 deletions

View File

@@ -58,13 +58,14 @@ function ImageGallery({
})}
/>
</div>
<Lightbox
images={images}
dialogTitle={title}
isOpen={isOpen}
onClose={() => setIsOpen(false)}
hideLabel={hideLabel}
/>
{isOpen ? (
<Lightbox
images={images}
dialogTitle={title}
onClose={() => setIsOpen(false)}
hideLabel={hideLabel}
/>
) : null}
</>
)
}