Skip to content

armgit / ente

Public Imported from GitHub
0

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

Shared date select

Manav Rathib785fe69f426
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsx
index 7e9415652d..367fea4b2d 100644
--- a/web/apps/photos/src/components/FileList.tsx
+++ b/web/apps/photos/src/components/FileList.tsx
@@ -677,10 +677,10 @@ export const FileList: React.FC<FileListProps> = ({
useEffect(() => {
// Nothing to do here if nothing is selected.
- if (!galleryContext.selectedFile) return;
+ if (!selected) return;
const notSelectedFiles = (annotatedFiles ?? []).filter(
- (item) => !galleryContext.selectedFile[item.file.id],
+ (item) => !selected[item.file.id],
);
const unselectedDates = new Set(
@@ -706,7 +706,7 @@ export const FileList: React.FC<FileListProps> = ({
localSelectedDates.forEach((date) => checked.add(date));
return checked;
});
- }, [galleryContext.selectedFile]);
+ }, [selected]);
const handleSelectMulti = handleSelectCreatorMulti(
setSelected,
@@ -847,9 +847,7 @@ export const FileList: React.FC<FileListProps> = ({
listItem: TimeStampListItem,
isScrolling: boolean,
) => {
- // Enhancement: This logic doesn't work on the shared album screen, the
- // galleryContext.selectedFile is always null there.
- const haveSelection = (galleryContext.selectedFile?.count ?? 0) > 0;
+ const haveSelection = (selected.count ?? 0) > 0;
switch (listItem.tag) {
case "date":
return listItem.dates ? (
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index cfb19d646a..edf969fc0a 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -135,7 +135,6 @@ const defaultGalleryContext: GalleryContextType = {
user: null,
userIDToEmailMap: null,
emailList: null,
- selectedFile: null,
};
export const GalleryContext = createContext<GalleryContextType>(
@@ -881,7 +880,6 @@ const Page: React.FC = () => {
// TODO(RE): Rename
userIDToEmailMap: state.emailByUserID,
emailList: state.shareSuggestionEmails,
- selectedFile: selected,
}}
>
<FullScreenDropZone
diff --git a/web/apps/photos/src/types/gallery/index.ts b/web/apps/photos/src/types/gallery/index.ts
index db469668f1..5549cf5cde 100644
--- a/web/apps/photos/src/types/gallery/index.ts
+++ b/web/apps/photos/src/types/gallery/index.ts
@@ -44,5 +44,4 @@ export interface GalleryContextType {
user: User;
userIDToEmailMap: Map<number, string>;
emailList: string[];
- selectedFile: SelectedState;
}