diff --git a/packages/mobile/src/screens/sign-on-screen/SignOnStack.tsx b/packages/mobile/src/screens/sign-on-screen/SignOnStack.tsx index 95c56fb3b42..8cf81af7249 100644 --- a/packages/mobile/src/screens/sign-on-screen/SignOnStack.tsx +++ b/packages/mobile/src/screens/sign-on-screen/SignOnStack.tsx @@ -1,7 +1,10 @@ import { useCallback, useState } from 'react' +import { accountSelectors } from '@audius/common/store' import type { NativeStackNavigationOptions } from '@react-navigation/native-stack' import { createNativeStackNavigator } from '@react-navigation/native-stack' +import { getSignOn } from 'audius-client/src/common/store/pages/signon/selectors' +import { useSelector } from 'react-redux' import { ScreenOptionsContext, defaultScreenOptions } from 'app/app/navigation' @@ -15,6 +18,7 @@ import { ReviewHandleScreen } from './screens/ReviewHandleScreen' import { SelectArtistsScreen } from './screens/SelectArtistScreen' import { SelectGenresScreen } from './screens/SelectGenresScreen' import { SignOnScreen } from './screens/SignOnScreen' +const { getAccountUser } = accountSelectors const Stack = createNativeStackNavigator() const screenOptionsOverrides = { animationTypeForReplace: 'pop' as const } @@ -31,11 +35,18 @@ export const SignOnStack = (props: SignOnStackProps) => { ...screenOptionsOverrides }) + const signUpState = useSelector(getSignOn) + const user = useSelector(getAccountUser) + const hasAccount = !!user + + const pastPhase1 = signUpState.finishedPhase1 || hasAccount + const updateOptions = useCallback( (newOptions: NativeStackNavigationOptions) => { setScreenOptions({ ...defaultScreenOptions, ...screenOptionsOverrides, + gestureEnabled: false, ...newOptions }) }, @@ -47,39 +58,44 @@ export const SignOnStack = (props: SignOnStackProps) => { value={{ options: screenOptions, updateOptions }} > - - - {() => ( - - )} - - - - - - - - - - null, gestureEnabled: false }} - /> - - - + {!pastPhase1 ? ( + + + {() => ( + + )} + + + + + + + + + ) : undefined} + null, gestureEnabled: false }} + /> + + ) diff --git a/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx index d942eb7aa3a..e3be769ec32 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx @@ -14,6 +14,7 @@ import { } from 'audius-client/src/common/store/pages/signon/selectors' import { setField, + setFinishedPhase1, setValueField, signUp } from 'common/store/pages/signon/actions' @@ -64,6 +65,7 @@ export const FinishProfileScreen = () => { const { displayName } = values dispatch(setValueField('name', displayName)) dispatch(signUp()) + dispatch(setFinishedPhase1(true)) navigation.navigate('SelectGenre') }, [dispatch, navigation]