Skip to content

armgit / ente

Public Imported from GitHub
0

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

Sketch

Manav Rathi7b8230fa6c7b
diff --git a/web/packages/new/photos/services/collection.ts b/web/packages/new/photos/services/collection.ts
index 76796f02f7..e1b7b3b5b3 100644
--- a/web/packages/new/photos/services/collection.ts
+++ b/web/packages/new/photos/services/collection.ts
@@ -436,6 +436,30 @@ const postCollectionsRename = async (renameRequest: RenameRequest) =>
}),
);
+/**
+ * Change the visibility (normal, archived, hidden) of a collection on remote.
+ *
+ * Remote only, does not modify local state.
+ *
+ * This function works with both collections owned by the user, and collections
+ * shared with the user.
+ *
+ * @param collection The collection whose visibility we want to change.
+ *
+ * @param visibility The new visibility (normal, archived, hidden).
+ */
+export const updateCollectionVisibility = async (
+ collection: Collection2,
+ visibility: ItemVisibility,
+) => {
+ if (collection.owner.id == ensureLocalUser().id) {
+ return updateCollectionPrivateMagicMetadata(collection, { visibility });
+ } else {
+ // TODO(C2):
+ return updateCollectionPrivateMagicMetadata(collection, { visibility });
+ }
+};
+
/**
* Update the private magic metadata contents of a collection on remote.
*