From 64fc7fa9b6ac87ffa0571474f25e66d6e012311e Mon Sep 17 00:00:00 2001
From: Reed <3893871+dharit-tan@users.noreply.github.com>
Date: Fri, 10 May 2024 17:47:24 -0400
Subject: [PATCH] [PAY-2975] Fix mobile-web premium album overflow options
(#8441)
---
packages/web/src/components/link/UserLink.tsx | 4 +++-
.../track/mobile/ConnectedPlaylistTile.tsx | 17 +++++++++++------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/packages/web/src/components/link/UserLink.tsx b/packages/web/src/components/link/UserLink.tsx
index 33b474830ff..64596d0825d 100644
--- a/packages/web/src/components/link/UserLink.tsx
+++ b/packages/web/src/components/link/UserLink.tsx
@@ -42,7 +42,9 @@ export const UserLink = (props: UserLinkProps) => {
ellipses={popover}
{...other}
>
- {userName}
+
+ {userName}
+
{
return tracks.some((track) => track.uid === playingUid)
}, [tracks, playingUid])
+ const hasStreamAccess = !!collection.access?.stream
const { isEnabled: isEditAlbumsEnabled } = useFlag(FeatureFlags.EDIT_ALBUMS)
@@ -179,12 +180,16 @@ const ConnectedPlaylistTile = ({
const onClickOverflow = useCallback(() => {
const overflowActions = [
- collection.has_current_user_reposted
- ? OverflowAction.UNREPOST
- : OverflowAction.REPOST,
- collection.has_current_user_saved
- ? OverflowAction.UNFAVORITE
- : OverflowAction.FAVORITE,
+ hasStreamAccess
+ ? collection.has_current_user_reposted
+ ? OverflowAction.UNREPOST
+ : OverflowAction.REPOST
+ : null,
+ hasStreamAccess
+ ? collection.has_current_user_saved && hasStreamAccess
+ ? OverflowAction.UNFAVORITE
+ : OverflowAction.FAVORITE
+ : null,
collection.is_album
? OverflowAction.VIEW_ALBUM_PAGE
: OverflowAction.VIEW_PLAYLIST_PAGE,