Skip to content

Commit 0a64f84

Browse files
authored
PAY-3291 Don't show purchase in overflow menu for non-purchase-gated tracks (#9335)
1 parent 0b2c061 commit 0a64f84

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/mobile/src/components/track-list/TrackListItem.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ const TrackListItemComponent = (props: TrackListItemComponentProps) => {
237237
const isPlaying = useSelector((state) => {
238238
return isActive && getPlaying(state)
239239
})
240+
const isPurchaseGated = isContentUSDCPurchaseGated(streamConditions)
240241
// Unlike other gated tracks, USDC purchase gated tracks are playable because they have previews
241-
const isPlayable =
242-
!isDeleted && (!isLocked || isContentUSDCPurchaseGated(streamConditions))
242+
const isPlayable = !isDeleted && (!isLocked || isPurchaseGated)
243243

244244
const messages = getMessages({ isDeleted })
245245
const styles = useStyles()
@@ -292,7 +292,7 @@ const TrackListItemComponent = (props: TrackListItemComponentProps) => {
292292
? OverflowAction.UNREPOST
293293
: OverflowAction.REPOST
294294
: null,
295-
!isTrackOwner && isLocked && !isDeleted
295+
!isTrackOwner && isLocked && isPurchaseGated && !isDeleted
296296
? OverflowAction.PURCHASE_TRACK
297297
: null,
298298
isTrackOwner && !ddexApp ? OverflowAction.ADD_TO_ALBUM : null,
@@ -334,7 +334,8 @@ const TrackListItemComponent = (props: TrackListItemComponentProps) => {
334334
isContextPlaylistOwner,
335335
dispatch,
336336
track_id,
337-
contextPlaylistId
337+
contextPlaylistId,
338+
isPurchaseGated
338339
])
339340

340341
const handlePressOverflow = (e: NativeSyntheticEvent<NativeTouchEvent>) => {

0 commit comments

Comments
 (0)