@@ -4,9 +4,7 @@ import ExpiredValidateCodeModal from '@components/ValidateCode/ExpiredValidateCo
44import JustSignedInModal from '@components/ValidateCode/JustSignedInModal' ;
55import ValidateCodeModal from '@components/ValidateCode/ValidateCodeModal' ;
66
7- import useNetwork from '@hooks/useNetwork' ;
87import useOnyx from '@hooks/useOnyx' ;
9- import useThemeStyles from '@hooks/useThemeStyles' ;
108
119import Log from '@libs/Log' ;
1210import Navigation from '@libs/Navigation/Navigation' ;
@@ -23,7 +21,6 @@ import type {OnyxEntry} from 'react-native-onyx';
2321
2422import { useFocusEffect } from '@react-navigation/native' ;
2523import React , { useCallback , useEffect , useState } from 'react' ;
26- import { StyleSheet , View } from 'react-native' ;
2724
2825import type ValidateLoginPageProps from './types' ;
2926
@@ -40,8 +37,6 @@ function ValidateLoginPage({
4037 const [ account ] = useOnyx ( ONYXKEYS . ACCOUNT ) ;
4138 const [ credentials ] = useOnyx ( ONYXKEYS . CREDENTIALS ) ;
4239 const [ session ] = useOnyx ( ONYXKEYS . SESSION ) ;
43- const { isOffline} = useNetwork ( ) ;
44- const styles = useThemeStyles ( ) ;
4540
4641 const login = credentials ?. login ;
4742 const isSignedIn = ! ! session ?. authToken && session ?. authTokenType !== CONST . AUTH_TOKEN_TYPES . ANONYMOUS ;
@@ -168,17 +163,6 @@ function ValidateLoginPage({
168163 return ( ) => clearTimeout ( timeoutID ) ;
169164 } , [ isCompletingDirectSignIn , autoAuthStateWithDefault ] ) ;
170165
171- const loadingIndicator = (
172- < FullScreenLoadingIndicator
173- // No "Go Back" button: this is a deep-link entry point, so there is usually no history to pop back to.
174- shouldUseGoBackButton = { false }
175- testID = "validate-login-loading"
176- />
177- ) ;
178- // Offline, a signed-out user's sign-in request waits in the queue until the network returns, so show why instead of a bare spinner.
179- // Signed-in users are sent on without waiting on a request, so they keep the loader.
180- const shouldShowOfflineView = isOffline && ! isSignedIn ;
181-
182166 return (
183167 < >
184168 { autoAuthStateWithDefault === CONST . AUTO_AUTH_STATE . FAILED && ! is2FARequired && < ExpiredValidateCodeModal /> }
@@ -193,15 +177,16 @@ function ValidateLoginPage({
193177 code = { validateCode }
194178 />
195179 ) }
196- { ( ( ! effectiveAutoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST . AUTO_AUTH_STATE . SIGNING_IN ) || isCompletingDirectSignIn ) &&
197- ( shouldShowOfflineView ? (
198- // The offline view has no background of its own, so paint one to cover whatever is underneath.
199- < View style = { [ StyleSheet . absoluteFill , styles . appBG ] } >
200- < FullPageOfflineBlockingView > { loadingIndicator } </ FullPageOfflineBlockingView >
201- </ View >
202- ) : (
203- loadingIndicator
204- ) ) }
180+ { ( ( ! effectiveAutoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST . AUTO_AUTH_STATE . SIGNING_IN ) || isCompletingDirectSignIn ) && (
181+ // Offline, the sign-in request waits in the queue until the network returns, so show why instead of a bare spinner.
182+ < FullPageOfflineBlockingView >
183+ < FullScreenLoadingIndicator
184+ // No "Go Back" button: this is a deep-link entry point, so there is usually no history to pop back to.
185+ shouldUseGoBackButton = { false }
186+ testID = "validate-login-loading"
187+ />
188+ </ FullPageOfflineBlockingView >
189+ ) }
205190 </ >
206191 ) ;
207192}
0 commit comments