re choose cover and new prompt
This commit is contained in:
@@ -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,
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user