Skip to content

Commit

Permalink
[PAY-3011] Fix add to playlist on web CollectionPage (#8478)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan authored May 15, 2024
1 parent f39cfaa commit 07c1607
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/web/src/components/tracks-table/TracksTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ export const TracksTable = ({
const renderOverflowMenuCell = useCallback(
(cellInfo: TrackCell) => {
const track = cellInfo.row.original
const {
stream_conditions: streamConditions,
is_stream_gated: isStreamGated
} = track
const { isFetchingNFTAccess, hasStreamAccess } = trackAccessMap[
track.track_id
] ?? { isFetchingNFTAccess: false, hasStreamAccess: true }
Expand All @@ -411,11 +415,11 @@ export const TracksTable = ({
if (shouldShowGatedType) {
Icon = track.is_unlisted
? IconVisibilityHidden
: isContentUSDCPurchaseGated(track.stream_conditions)
: isContentUSDCPurchaseGated(streamConditions)
? IconCart
: isContentCollectibleGated(track.stream_conditions)
: isContentCollectibleGated(streamConditions)
? IconCollectible
: isContentFollowGated(track.stream_conditions)
: isContentFollowGated(streamConditions)
? IconSpecialAccess
: null
} else {
Expand Down Expand Up @@ -450,7 +454,9 @@ export const TracksTable = ({
}
: {
includeEdit: !disabledTrackEdit,
includeAddToPlaylist: !isLocked && !track.is_stream_gated,
includeAddToPlaylist:
!isStreamGated ||
(isContentUSDCPurchaseGated(streamConditions) && hasStreamAccess),
onRemove: onClickRemove,
removeText
}
Expand Down

0 comments on commit 07c1607

Please sign in to comment.