Skip to content

armgit / ente

Public Imported from GitHub
0

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

Undep

Manav Rathi87ff5c5c0b2e
diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo.tsx
index 3f27dc44c0..e5b79af4d6 100644
--- a/web/apps/photos/src/components/PhotoViewer/FileInfo.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/FileInfo.tsx
@@ -76,7 +76,6 @@ import {
} from "@mui/material";
import { Formik } from "formik";
import { t } from "i18next";
-import { GalleryContext } from "pages/gallery";
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
import { PublicCollectionGalleryContext } from "utils/publicCollectionGallery";
import * as Yup from "yup";
@@ -108,6 +107,11 @@ export interface FileInfoProps {
fileToCollectionsMap?: Map<number, number[]>;
collectionNameMap?: Map<number, string>;
showCollectionChips: boolean;
+ /**
+ * Called when the user selects a collection from among the collections that
+ * the file belongs to.
+ */
+ onSelectCollection: (collectionID: number) => void;
/**
* Called when the user selects a person in the file info panel.
*/
@@ -126,12 +130,12 @@ export const FileInfo: React.FC<FileInfoProps> = ({
collectionNameMap,
showCollectionChips,
closePhotoViewer,
+ onSelectCollection,
onSelectPerson,
}) => {
const { mapEnabled } = useSettingsSnapshot();
const { showMiniDialog } = useContext(AppContext);
- const galleryContext = useContext(GalleryContext);
const publicCollectionGalleryContext = useContext(
PublicCollectionGalleryContext,
);
@@ -173,7 +177,7 @@ export const FileInfo: React.FC<FileInfoProps> = ({
}
const onCollectionChipClick = (collectionID) => {
- galleryContext.onShowCollection(collectionID);
+ onSelectCollection(collectionID);
closePhotoViewer();
};
diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx
index 16d04eb195..6d47486512 100644
--- a/web/apps/photos/src/components/PhotoViewer/index.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/index.tsx
@@ -975,6 +975,7 @@ export const PhotoViewer: React.FC<PhotoViewerProps> = ({
refreshPhotoswipe={refreshPhotoswipe}
fileToCollectionsMap={fileToCollectionsMap}
collectionNameMap={collectionNameMap}
+ onSelectCollection={galleryContext.onShowCollection}
onSelectPerson={onSelectPerson}
/>
<ImageEditorOverlay