Skip to content

armgit / ente

Public Imported from GitHub
0

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

refractor(collection-summary):removed-unwanted-function

Aswin Asok2184d63159ed
diff --git a/web/packages/new/photos/components/CollectionSelector.tsx b/web/packages/new/photos/components/CollectionSelector.tsx
index 254f15ad39..93024aa0a2 100644
--- a/web/packages/new/photos/components/CollectionSelector.tsx
+++ b/web/packages/new/photos/components/CollectionSelector.tsx
@@ -29,7 +29,6 @@ import {
import {
canAddToCollection,
canMoveToCollection,
- canUploadToCollection,
collectionsSortBy,
sortCollectionSummaries,
type CollectionsSortBy,
@@ -167,12 +166,11 @@ export const CollectionSelector: React.FC<CollectionSelectorProps> = ({
} else if (attributes.action == "add") {
return canAddToCollection(cs) && cs.type != "userFavorites";
} else if (attributes.action == "upload") {
- // Use upload eligibility (not move eligibility) so shared incoming
+ // Using add eligibility (not move eligibility) so shared incoming
// albums are available as upload targets. Viewer-only shared incoming
- // albums are still excluded by `canUploadToCollection`.
+ // albums are still excluded by `canAddToCollection`.
return (
- (canUploadToCollection(cs) ||
- cs.type == "uncategorized") &&
+ (canAddToCollection(cs) || cs.type == "uncategorized") &&
cs.type != "userFavorites"
);
} else if (attributes.action == "restore") {
diff --git a/web/packages/new/photos/services/collection-summary.ts b/web/packages/new/photos/services/collection-summary.ts
index 090d300fc7..0ce77e61ca 100644
--- a/web/packages/new/photos/services/collection-summary.ts
+++ b/web/packages/new/photos/services/collection-summary.ts
@@ -224,9 +224,6 @@ export const haveOnlySystemCollections = (
export const canAddToCollection = ({ attributes }: CollectionSummary) =>
!attributes.has("system") && !attributes.has("sharedIncomingViewer");
-export const canUploadToCollection = (summary: CollectionSummary) =>
- canAddToCollection(summary);
-
export const canMoveToCollection = ({ attributes }: CollectionSummary) =>
!attributes.has("system") && !attributes.has("sharedIncoming");