This commit is contained in:
@@ -19,12 +19,6 @@ export default function Gallery({
|
|||||||
string | null
|
string | null
|
||||||
>(null);
|
>(null);
|
||||||
|
|
||||||
/*
|
|
||||||
* Update the URL without causing a Next.js navigation.
|
|
||||||
*
|
|
||||||
* router.replace() would render the server page again, causing
|
|
||||||
* /api/images and /api/tags to be requested again.
|
|
||||||
*/
|
|
||||||
const setFullScreenImage = useCallback((imageId: string | null) => {
|
const setFullScreenImage = useCallback((imageId: string | null) => {
|
||||||
setFullScreenImageIdState(imageId);
|
setFullScreenImageIdState(imageId);
|
||||||
|
|
||||||
@@ -43,7 +37,6 @@ export default function Gallery({
|
|||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Read a fullscreen image from the initial URL.
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const synchronizeWithUrl = () => {
|
const synchronizeWithUrl = () => {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
@@ -59,7 +52,6 @@ export default function Gallery({
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Prevent the gallery page from scrolling while the modal is open.
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!fullScreenImageId) {
|
if (!fullScreenImageId) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user