re choose cover and new prompt

This commit is contained in:
2026-02-24 10:54:19 +01:00
parent e608c17775
commit b5d54226b1
8 changed files with 376 additions and 128 deletions
+18 -1
View File
@@ -40,6 +40,8 @@ const SongDownload = ({ route }) => {
project: routeProject,
selectedOption: routeSelectedOption,
coverOptions: routeCoverOptions,
skipAdventureGate = false,
promptPurchaseConfirm = false,
} = route?.params || {}
const { selectedProject, updateProjectData, hasActiveSubscription } = useUser()
const { createSongDownloadCheckout } = useStripe()
@@ -53,7 +55,9 @@ const SongDownload = ({ route }) => {
const [showIntro, setShowIntro] = useState(null)
const [showAdventureModal, setShowAdventureModal] = useState(false)
const [showShareModal, setShowShareModal] = useState(false)
const [adventureChoice, setAdventureChoice] = useState('pending')
const [adventureChoice, setAdventureChoice] = useState(() =>
skipAdventureGate ? 'stop' : 'pending'
)
const adventureGateTriggeredRef = useRef(false)
const projectForStage = useMemo(() => {
@@ -467,6 +471,18 @@ const SongDownload = ({ route }) => {
)
return
}
if (promptPurchaseConfirm) {
Alert.alert(
'Acheter ce morceau',
'Voulez-vous acheter ce morceau pour 1,99€ ?',
[
{ text: 'Annuler', style: 'cancel' },
{ text: 'Acheter', onPress: () => startSongDownloadCheckout() },
],
{ cancelable: true }
)
return
}
startSongDownloadCheckout()
}, [
canDownloadDirectly,
@@ -474,6 +490,7 @@ const SongDownload = ({ route }) => {
handleDownload,
isCheckoutLaunching,
isDownloading,
promptPurchaseConfirm,
startSongDownloadCheckout,
])