Fixes bug with gallery not closing

This commit is contained in:
psychedelicious 2022-10-28 21:01:23 +11:00
parent 35dba1381c
commit c48a1092f7
2 changed files with 3 additions and 5 deletions

View File

@ -123,10 +123,8 @@ export default function ImageGallery() {
galleryContainerRef.current ? galleryContainerRef.current.scrollTop : 0
)
);
if (!shouldHoldGalleryOpen) {
dispatch(setShouldHoldGalleryOpen(false));
}
dispatch(setShouldShowGallery(false));
dispatch(setShouldHoldGalleryOpen(false));
};
const handleClickLoadMore = () => {
@ -254,7 +252,7 @@ export default function ImageGallery() {
return (
<CSSTransition
nodeRef={galleryRef}
in={shouldShowGallery || shouldHoldGalleryOpen}
in={shouldShowGallery || (shouldHoldGalleryOpen && !shouldPinGallery)}
unmountOnExit
timeout={200}
classNames="image-gallery-area"

View File

@ -30,7 +30,7 @@ const initialState: GalleryState = {
shouldShowGallery: true,
galleryScrollPosition: 0,
galleryImageMinimumWidth: 64,
galleryImageObjectFit: 'contain',
galleryImageObjectFit: 'cover',
shouldHoldGalleryOpen: false,
shouldAutoSwitchToNewImages: true,
};