feat: center generation text
This commit is contained in:
@@ -19,7 +19,7 @@ import GradientButton from '../../components/GradientButton'
|
||||
import MusicLandHeader from '../../components/MusicLandHeader'
|
||||
import Page from '../../layouts/Page'
|
||||
import { Routes } from '../../navigation/Routes'
|
||||
import { goBack, navigate } from '../../navigation/NavigationService'
|
||||
import { goBack, navigate, push } from '../../navigation/NavigationService'
|
||||
import { useUser } from '../../providers/UserDataProvider'
|
||||
import { useStripe } from '../../providers/StripeProvider'
|
||||
import { gutters, Palette, Style } from '../../styles'
|
||||
@@ -63,6 +63,7 @@ const SongDownload = ({ route }) => {
|
||||
skipAdventureGate ? 'stop' : 'pending'
|
||||
)
|
||||
const adventureGateTriggeredRef = useRef(false)
|
||||
const reopenAdventureModalOnFocusRef = useRef(false)
|
||||
|
||||
const projectForStage = useMemo(() => {
|
||||
if (routeProject?.id && selectedProject?.id && routeProject.id === selectedProject.id) {
|
||||
@@ -134,6 +135,17 @@ const SongDownload = ({ route }) => {
|
||||
}, [backRoute, handleBackPress])
|
||||
)
|
||||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
if (!reopenAdventureModalOnFocusRef.current) {
|
||||
return undefined
|
||||
}
|
||||
setShowIntro(null)
|
||||
setShowAdventureModal(true)
|
||||
return undefined
|
||||
}, [])
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (adventureGateTriggeredRef.current) {
|
||||
return
|
||||
@@ -194,7 +206,10 @@ const SongDownload = ({ route }) => {
|
||||
const nextPlaybackStage = getStageAction('director', nextProject)
|
||||
const targetRoute = nextPlaybackStage?.route || Routes.Playback
|
||||
const params = nextPlaybackStage?.params || { project: nextProject }
|
||||
navigate(targetRoute, params)
|
||||
push(targetRoute, {
|
||||
...params,
|
||||
returnToAdventureModal: true,
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('[SongDownload] continue error', error?.message)
|
||||
} finally {
|
||||
@@ -203,8 +218,8 @@ const SongDownload = ({ route }) => {
|
||||
}, [
|
||||
coverOptions,
|
||||
coverUrl,
|
||||
navigate,
|
||||
projectForStage,
|
||||
push,
|
||||
selectedOption,
|
||||
setLoading,
|
||||
updateProjectData,
|
||||
@@ -216,6 +231,7 @@ const SongDownload = ({ route }) => {
|
||||
}, [])
|
||||
|
||||
const handleContinueAdventure = useCallback(() => {
|
||||
reopenAdventureModalOnFocusRef.current = true
|
||||
setShowAdventureModal(false)
|
||||
setAdventureChoice('continue')
|
||||
continueFlow()
|
||||
@@ -526,6 +542,7 @@ const SongDownload = ({ route }) => {
|
||||
}, [downloadPaymentPending, handleDownload, hasPaidDownload, isDownloading])
|
||||
|
||||
const handleStopAdventure = useCallback(() => {
|
||||
reopenAdventureModalOnFocusRef.current = false
|
||||
setShowAdventureModal(false)
|
||||
setAdventureChoice('stop')
|
||||
}, [])
|
||||
|
||||
Reference in New Issue
Block a user