Skip to content

Commit

Permalink
[C-3898] Fix faded gray screen android on sign up (#7730)
Browse files Browse the repository at this point in the history
  • Loading branch information
DejayJD authored Feb 28, 2024
1 parent a0d314b commit 0d15ae7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/mobile/src/screens/root-screen/RootScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useState } from 'react'

import { Status } from '@audius/common/models'
import { MobileOS, Status } from '@audius/common/models'
import { FeatureFlags } from '@audius/common/services'
import {
accountSelectors,
Expand All @@ -13,6 +13,7 @@ import {
getStartedSignUpProcess,
getWelcomeModalShown
} from 'common/store/pages/signon/selectors'
import { Platform } from 'react-native'
import { useDispatch, useSelector } from 'react-redux'

import useAppState from 'app/hooks/useAppState'
Expand Down Expand Up @@ -63,6 +64,7 @@ export const RootScreen = () => {
const showHomeStack = useSelector(getHasCompletedAccount)
const startedSignUp = useSelector(getStartedSignUpProcess)
const welcomeModalShown = useSelector(getWelcomeModalShown)
const isAndroid = Platform.OS === MobileOS.ANDROID

const [isLoaded, setIsLoaded] = useState(false)
const [isSplashScreenDismissed, setIsSplashScreenDismissed] = useState(false)
Expand Down Expand Up @@ -154,7 +156,7 @@ export const RootScreen = () => {
name='HomeStack'
component={AppDrawerScreen}
// animation: none here is a workaround to prevent "white screen of death" on Android
options={{ animation: 'none' }}
options={isAndroid ? { animation: 'none' } : undefined}
/>
) : isSignUpRedesignEnabled ? (
<Stack.Screen name='SignOnStackNew'>
Expand Down
15 changes: 13 additions & 2 deletions packages/mobile/src/screens/sign-on-screen/SignOnStack.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useCallback, useState } from 'react'

import { MobileOS } from '@audius/common/models'
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 { Platform } from 'react-native'
import { useSelector } from 'react-redux'

import { ScreenOptionsContext, defaultScreenOptions } from 'app/app/navigation'
Expand Down Expand Up @@ -41,6 +43,8 @@ export const SignOnStack = (props: SignOnStackProps) => {

const pastPhase1 = signUpState.finishedPhase1 || hasAccount

const isAndroid = Platform.OS === MobileOS.ANDROID

const updateOptions = useCallback(
(newOptions: NativeStackNavigationOptions) => {
setScreenOptions({
Expand Down Expand Up @@ -87,14 +91,21 @@ export const SignOnStack = (props: SignOnStackProps) => {
<Stack.Screen
name='SelectGenre'
component={SelectGenresScreen}
options={{ headerLeft: () => null, gestureEnabled: false }}
options={{
headerLeft: () => null,
gestureEnabled: false,
...(isAndroid ? { animation: 'none' } : undefined)
}}
/>
<Stack.Screen name='SelectArtists' component={SelectArtistsScreen} />
<Stack.Screen
name='AccountLoading'
component={AccountLoadingScreen}
// animation: none here is a workaround to prevent "white screen of death" on Android
options={{ headerShown: false, animation: 'none' }}
options={{
headerShown: false,
...(isAndroid ? { animation: 'none' } : undefined)
}}
/>
</Stack.Navigator>
</ScreenOptionsContext.Provider>
Expand Down

0 comments on commit 0d15ae7

Please sign in to comment.