Skip to content

Commit

Permalink
Re-add downloads when lossless downloads flag disabled (#7235)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan authored Jan 18, 2024
1 parent 0ffd417 commit f355286
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions packages/web/src/components/track/GiantTrackTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import styles from './GiantTrackTile.module.css'
import { GiantTrackTileProgressInfo } from './GiantTrackTileProgressInfo'
import InfoLabel from './InfoLabel'
import { PlayPauseButton } from './PlayPauseButton'
import DownloadButtons from 'components/download-buttons/DownloadButtons'

const { requestOpen: openPublishTrackConfirmationModal } =
publishTrackConfirmationModalUIActions
Expand Down Expand Up @@ -503,12 +504,26 @@ export const GiantTrackTile = ({
</>
)
}

const renderScheduledReleaseRow = () => {
return (
<ScheduledReleaseGiantLabel released={released} isUnlisted={isUnlisted} />
)
}

const renderDownloadButtons = () => {
return (
<DownloadButtons
className={styles.downloadButtonsContainer}
trackId={trackId}
isOwner={isOwner}
following={following}
hasDownloadAccess={hasDownloadAccess}
onDownload={onDownload}
/>
)
}

const isLoading = loading || artworkLoading
// Omitting isOwner and hasStreamAccess so that we always show gated DogEars
const dogEarType = isLoading
Expand Down Expand Up @@ -668,10 +683,7 @@ export const GiantTrackTile = ({
</div>
</div>

{isStreamGated &&
streamConditions &&
isLosslessDownloadsEnabled &&
!hasDownloadableAssets ? (
{isStreamGated && streamConditions ? (
<GatedTrackSection
isLoading={isLoading}
trackId={trackId}
Expand Down Expand Up @@ -715,6 +727,7 @@ export const GiantTrackTile = ({
</UserGeneratedText>
) : null}
{renderTags()}
{!isLosslessDownloadsEnabled ? renderDownloadButtons() : null}
{isLosslessDownloadsEnabled && hasDownloadableAssets ? (
<Box pt='l' w='100%'>
<DownloadSection trackId={trackId} onDownload={onDownload} />
Expand Down

0 comments on commit f355286

Please sign in to comment.