Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(web): Gate shareePinned feature behind flag

Prateek Sunal28309f44e568
diff --git a/web/packages/new/photos/components/gallery/BarImpl.tsx b/web/packages/new/photos/components/gallery/BarImpl.tsx
index 1f31f60963..6cf7b06405 100644
--- a/web/packages/new/photos/components/gallery/BarImpl.tsx
+++ b/web/packages/new/photos/components/gallery/BarImpl.tsx
@@ -6,6 +6,7 @@ import NavigateNextIcon from "@mui/icons-material/NavigateNext";
import PeopleIcon from "@mui/icons-material/People";
import PushPinIcon from "@mui/icons-material/PushPin";
import { Box, IconButton, Stack, Typography, styled } from "@mui/material";
+import { settingsSnapshot } from "ente-new/photos/services/settings";
import { Overlay } from "ente-base/components/containers";
import { FilledIconButton } from "ente-base/components/mui";
import { Ellipsized2LineTypography } from "ente-base/components/Typography";
@@ -539,7 +540,9 @@ const CollectionBarCardIcon: React.FC<CollectionBarCardIconProps> = ({
// shared album that is also archived), and there is enough space for 3.
<CollectionBarCardIcon_>
{attributes.has("userFavorites") && <FavoriteRoundedIcon />}
- {(attributes.has("pinned") || attributes.has("shareePinned")) && (
+ {(attributes.has("pinned") ||
+ (attributes.has("shareePinned") &&
+ settingsSnapshot().isShareePinEnabled)) && (
// Need && to override the 20px set in the container.
<PushPinIcon sx={{ "&&": { fontSize: "18px" } }} />
)}
diff --git a/web/packages/new/photos/components/gallery/reducer.ts b/web/packages/new/photos/components/gallery/reducer.ts
index 7327fb9e59..984961b277 100644
--- a/web/packages/new/photos/components/gallery/reducer.ts
+++ b/web/packages/new/photos/components/gallery/reducer.ts
@@ -20,6 +20,7 @@ import {
isArchivedCollection,
isHiddenCollection,
} from "ente-new/photos/services/collection";
+import { settingsSnapshot } from "ente-new/photos/services/settings";
import { sortTrashItems, type TrashItem } from "ente-new/photos/services/trash";
import { splitByPredicate } from "ente-utils/array";
import { includes } from "ente-utils/type-guards";
@@ -1537,7 +1538,9 @@ const createCollectionSummaries = (
sortPriority = CollectionSummarySortPriority.pinned;
}
// Check for sharee pinned (for incoming shared collections)
+ // Only apply when the feature flag is enabled
if (
+ settingsSnapshot().isShareePinEnabled &&
type == "sharedIncoming" &&
collection.sharedMagicMetadata?.data.order == CollectionOrder.pinned
) {