Skip to content

armgit / ente

Public Imported from GitHub
0

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

Reorder

Manav Rathi9f9aa17cb412
diff --git a/web/packages/new/photos/services/collection.ts b/web/packages/new/photos/services/collection.ts
index 7dbca8aacf..2b91e367fb 100644
--- a/web/packages/new/photos/services/collection.ts
+++ b/web/packages/new/photos/services/collection.ts
@@ -50,17 +50,6 @@ const defaultHiddenCollectionName = ".hidden";
export const defaultHiddenCollectionUserFacingName = "Hidden";
const favoritesCollectionName = "Favorites";
-/**
- * Return the "user facing" name of the given collection.
- *
- * Usually this is the same as the collection name, but it might be a different
- * string for special collections like default hidden collections.
- */
-export const collectionUserFacingName = (collection: Collection) =>
- isDefaultHiddenCollection(collection)
- ? defaultHiddenCollectionUserFacingName
- : collection.name;
-
/**
* Create a new album (a collection of type "album") on remote, and return its
* local representation.
@@ -262,6 +251,17 @@ export const getCollectionChanges = async (
export const createCollectionNameByID = (collections: Collection[]) =>
new Map(collections.map((c) => [c.id, collectionUserFacingName(c)]));
+/**
+ * Return the "user facing" name of the given collection.
+ *
+ * Usually this is the same as the collection name, but it might be a different
+ * string for special collections like default hidden collections.
+ */
+export const collectionUserFacingName = (collection: Collection) =>
+ isDefaultHiddenCollection(collection)
+ ? defaultHiddenCollectionUserFacingName
+ : collection.name;
+
/**
* A CollectionFileItem represents a file in a API request to add, move or
* restore files to a particular collection.
@@ -747,15 +747,15 @@ export const findDefaultHiddenCollectionIDs = (collections: Collection[]) =>
.map((collection) => collection.id),
);
+export const isHiddenCollection = (collection: Collection) =>
+ collection.magicMetadata?.data.visibility === ItemVisibility.hidden;
+
/**
* Return true if this is a collection that the user doesn't own.
*/
export const isIncomingShare = (collection: Collection, user: User) =>
collection.owner.id !== user.id;
-export const isHiddenCollection = (collection: Collection) =>
- collection.magicMetadata?.data.visibility === ItemVisibility.hidden;
-
/**
* Share the provided collection with another Ente user.
*