Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix

Manav Rathi1ca478af84a3
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index e2c4b85955..ad7e5fc7ad 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -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));
diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsx
index f8594f232e..0919b610cd 100644
--- a/web/apps/photos/src/pages/shared-albums.tsx
+++ b/web/apps/photos/src/pages/shared-albums.tsx
@@ -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],