π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Allow hiding shared albums
Anand Baburajan92a50856686f
diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsxindex a48f4873c7..967bd98a6f 100644--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx@@ -541,6 +541,25 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({{t("archive_album")}</OverflowMenuOption>),+ activeCollection ? (+ isHiddenCollection(activeCollection) ? (+ <OverflowMenuOption+ key="unhide"+ onClick={unhideAlbum}+ startIcon={<VisibilityOutlinedIcon />}+ >+ {t("unhide_collection")}+ </OverflowMenuOption>+ ) : (+ <OverflowMenuOption+ key="hide"+ onClick={hideAlbum}+ startIcon={<VisibilityOffOutlinedIcon />}+ >+ {t("hide_collection")}+ </OverflowMenuOption>+ )+ ) : undefined,<OverflowMenuOptionkey="leave"startIcon={<LogoutIcon />}diff --git a/web/packages/new/photos/services/collection.ts b/web/packages/new/photos/services/collection.tsindex 4383df7f64..c543bcfc99 100644--- a/web/packages/new/photos/services/collection.ts+++ b/web/packages/new/photos/services/collection.ts@@ -1339,11 +1339,20 @@ export const findDefaultHiddenCollectionIDs = (collections: Collection[]) =>/*** Return `true` if the given collection is hidden.*- * Hidden collections are those that have their visibility set to hidden in the- * collection's owner's private magic metadata.+ * Hidden collections are those that have their visibility set to hidden for+ * the current user (owner or sharee).*/-export const isHiddenCollection = (collection: Collection) =>- collection.magicMetadata?.data.visibility == ItemVisibility.hidden;+export const isHiddenCollection = (collection: Collection) => {+ const userID = ensureLocalUser().id;+ if (collection.owner.id == userID) {+ return (+ collection.magicMetadata?.data.visibility == ItemVisibility.hidden+ );+ }+ return (+ collection.sharedMagicMetadata?.data.visibility == ItemVisibility.hidden+ );+};/*** Return `true` if the given collection is archived.