diff --git a/web/apps/photos/src/components/PhotoList/index.tsx b/web/apps/photos/src/components/PhotoList/index.tsx index 3eee1d683..e6d955cda 100644 --- a/web/apps/photos/src/components/PhotoList/index.tsx +++ b/web/apps/photos/src/components/PhotoList/index.tsx @@ -780,23 +780,28 @@ export function PhotoList({ 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; switch (listItem.itemType) { case ITEM_TYPE.TIME: return listItem.dates ? ( listItem.dates .map((item) => [ - - onChangeSelectAllCheckBox(item.date) - } - size="small" - sx={{ pl: 0 }} - disableRipple={true} - /> + {haveSelection && ( + + onChangeSelectAllCheckBox(item.date) + } + size="small" + sx={{ pl: 0 }} + disableRipple={true} + /> + )} {item.date} ,
, @@ -804,17 +809,19 @@ export function PhotoList({ .flat() ) : ( - - onChangeSelectAllCheckBox(listItem.date) - } - size="small" - sx={{ pl: 0 }} - disableRipple={true} - /> + {haveSelection && ( + + onChangeSelectAllCheckBox(listItem.date) + } + size="small" + sx={{ pl: 0 }} + disableRipple={true} + /> + )} {listItem.date} );