mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-25 01:34:51 +01:00
fix
This commit is contained in:
parent
d4907fc810
commit
a4872e7ea0
@ -46,7 +46,7 @@ export default function ImageViewer() {
|
|||||||
}, [image]);
|
}, [image]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
MediaPageStore.on('page_init', onImageLoad);
|
MediaPageStore.on('loaded_image_data', onImageLoad);
|
||||||
return () => MediaPageStore.removeListener('loaded_image_data', onImageLoad);
|
return () => MediaPageStore.removeListener('loaded_image_data', onImageLoad);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ export default function ImageViewer() {
|
|||||||
document.removeEventListener('keydown', handleKeyDown);
|
document.removeEventListener('keydown', handleKeyDown);
|
||||||
};
|
};
|
||||||
}, [isModalOpen, slideshowItems]);
|
}, [isModalOpen, slideshowItems]);
|
||||||
|
|
||||||
|
|
||||||
const handleKeyDown = (event) => {
|
const handleKeyDown = (event) => {
|
||||||
if (!isModalOpen) return;
|
if (!isModalOpen) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user