Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(PickCoverPhotoDialog):minor-corrections

Aswin Asok91b4e387d050
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index 5333554d31..acc4108a7a 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -254,6 +254,8 @@ export const GalleryBarAndListHeader: React.FC<
collectionNameByID,
onSelectCollection,
onSelectPerson,
+ canSetAlbumCover,
+ onSetAlbumCover,
// TODO: Cluster
// This causes a loop since it is an array dep
// people,
diff --git a/web/apps/photos/src/components/Collections/PickCoverPhotoDialog.tsx b/web/apps/photos/src/components/Collections/PickCoverPhotoDialog.tsx
index 313e7f73f9..60f4651621 100644
--- a/web/apps/photos/src/components/Collections/PickCoverPhotoDialog.tsx
+++ b/web/apps/photos/src/components/Collections/PickCoverPhotoDialog.tsx
@@ -96,9 +96,9 @@ export const PickCoverPhotoDialog: React.FC<PickCoverPhotoDialogProps> = ({
(index: number) => {
const file = annotatedFiles[index]?.file;
if (!file) return;
- setSelected(createSingleSelection(file, collection.id));
+ setSelected(createSingleSelection(file, collection.id, user.id));
},
- [annotatedFiles, collection.id],
+ [annotatedFiles, collection.id, user.id],
);
const handleUseSelectedPhoto = useCallback(async () => {
@@ -318,11 +318,12 @@ const createEmptySelection = (collectionID: number): SelectedState => ({
const createSingleSelection = (
file: EnteFile,
collectionID: number,
+ userID: number,
): SelectedState =>
({
[file.id]: true,
- ownCount: 0,
- count: 0,
+ ownCount: file.ownerID === userID ? 1 : 0,
+ count: 1,
collectionID,
context: { mode: "albums", collectionID },
}) as SelectedState;