Fix
This commit is contained in:
@@ -111,7 +111,7 @@ import { UploadSelectorInputs } from "components/UploadSelectorInputs";
|
||||
import SelectedFileOptions from "components/pages/gallery/SelectedFileOptions";
|
||||
import { t } from "i18next";
|
||||
import { useRouter, type NextRouter } from "next/router";
|
||||
import { createContext, useCallback, useEffect, useRef, useState } from "react";
|
||||
import { createContext, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { Trans } from "react-i18next";
|
||||
import {
|
||||
@@ -194,7 +194,7 @@ export default function Gallery() {
|
||||
// ... the props we should apply to the <input> element,
|
||||
getInputProps: getDragAndDropInputProps,
|
||||
// ... and the files that we got.
|
||||
acceptedFiles: dragAndDropFiles,
|
||||
acceptedFiles: dragAndDropFilesReadOnly,
|
||||
} = useDropzone({
|
||||
noClick: true,
|
||||
noKeyboard: true,
|
||||
@@ -548,6 +548,12 @@ export default function Gallery() {
|
||||
};
|
||||
}, [selectAll, clearSelection]);
|
||||
|
||||
// Create a regular array from the readonly array returned by dropzone.
|
||||
const dragAndDropFiles = useMemo(
|
||||
() => [...dragAndDropFilesReadOnly],
|
||||
[dragAndDropFilesReadOnly],
|
||||
);
|
||||
|
||||
const showSessionExpiredDialog = () =>
|
||||
showMiniDialog(sessionExpiredDialogAttributes(logout));
|
||||
|
||||
|
||||
@@ -175,8 +175,7 @@ export default function PublicCollectionGallery() {
|
||||
return updater;
|
||||
};
|
||||
|
||||
// Create a regular array from the readonly array returned by the dropzone
|
||||
// library.
|
||||
// Create a regular array from the readonly array returned by dropzone.
|
||||
const dragAndDropFiles = useMemo(
|
||||
() => [...dragAndDropFilesReadOnly],
|
||||
[dragAndDropFilesReadOnly],
|
||||
|
||||
Reference in New Issue
Block a user