Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web] Prevent album admins from adding owner as participant

Anand Baburajan6839bbc5611b
diff --git a/web/apps/photos/src/components/Collections/CollectionShare.tsx b/web/apps/photos/src/components/Collections/CollectionShare.tsx
index cf790cc9d3..983b9a61db 100644
--- a/web/apps/photos/src/components/Collections/CollectionShare.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionShare.tsx
@@ -641,6 +641,14 @@ const AddParticipant: React.FC<AddParticipantProps> = ({
if (email == user.email) {
setEmailFieldError(t("sharing_with_self"));
return;
+ } else if (
+ collection.owner?.email &&
+ email == collection.owner.email
+ ) {
+ setEmailFieldError(
+ t("sharing_already_shared", { email: email }),
+ );
+ return;
} else if (
collection?.sharees?.find((value) => value.email === email)
) {