Skip to content

armgit / ente

Public Imported from GitHub
0

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

refractor(CollectionMapDialog):removed-edit-photos

Aswin Asokdfad7f87e998
diff --git a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
index 9ac689c34c..7180916ee1 100644
--- a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
@@ -1198,6 +1198,7 @@ function CollectionSidebar({
collectionNameByID={collectionNameByID}
onSelectCollection={onSelectCollection}
onSelectPerson={onSelectPerson}
+ enableImageEditing={false}
enableDownload={true}
activeCollectionID={collectionSummary.id}
selected={selected}
diff --git a/web/apps/photos/src/components/FileListWithViewer.tsx b/web/apps/photos/src/components/FileListWithViewer.tsx
index 945c9c6105..5e5eec60d0 100644
--- a/web/apps/photos/src/components/FileListWithViewer.tsx
+++ b/web/apps/photos/src/components/FileListWithViewer.tsx
@@ -28,6 +28,7 @@ export type FileListWithViewerProps = {
*/
files: EnteFile[];
enableDownload?: boolean;
+ enableImageEditing?: boolean;
/**
* Called when the component wants to mark the given files as deleted in the
* the in-memory, unsynced, state maintained by the top level gallery.
@@ -102,6 +103,7 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({
user,
files,
enableDownload,
+ enableImageEditing = true,
disableGrouping,
enableSelect,
selected,
@@ -172,14 +174,14 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({
: undefined;
}, [onMarkTempDeleted]);
- const handleSaveEditedImageCopy = useCallback(
- (editedFile: File, collection: Collection, enteFile: EnteFile) => {
+ const handleSaveEditedImageCopy = useMemo(() => {
+ if (!enableImageEditing) return undefined;
+ return (editedFile: File, collection: Collection, enteFile: EnteFile) => {
uploadManager.prepareForNewUpload();
uploadManager.showUploadProgressDialog();
void uploadManager.uploadFile(editedFile, collection, enteFile);
- },
- [],
- );
+ };
+ }, [enableImageEditing]);
return (
<Container>