diff --git a/src/Expensify.tsx b/src/Expensify.tsx index cd249b055d07..aa374ff935ae 100644 --- a/src/Expensify.tsx +++ b/src/Expensify.tsx @@ -118,11 +118,11 @@ function Expensify() { const autoAuthState = useMemo(() => session?.autoAuthState ?? '', [session]); const shouldInit = isNavigationReady && hasAttemptedToOpenPublicRoom; - const shouldHideSplash = true; - // shouldInit && - // (NativeModules.HybridAppModule - // ? splashScreenState === CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN && (isAuthenticated || useNewDotSignInPage) - // : splashScreenState === CONST.BOOT_SPLASH_STATE.VISIBLE); + const shouldHideSplash = + shouldInit && + (NativeModules.HybridAppModule + ? splashScreenState === CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN && (isAuthenticated || useNewDotSignInPage) + : splashScreenState === CONST.BOOT_SPLASH_STATE.VISIBLE); const initializeClient = () => { if (!Visibility.isVisible()) { diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index b34f50b50e96..a0e688643de9 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -517,11 +517,6 @@ function signInAfterTransitionFromOldDot(transitionURL: string) { Onyx.multiSet({ [ONYXKEYS.USE_NEWDOT_SIGN_IN_PAGE]: useNewDotSignInPage === 'true', [ONYXKEYS.NVP_TRYNEWDOT]: {classicRedirect: {dismissed}}, // This data is mocked and should be returned by BeginSignUp/SignInUser API commands - [ONYXKEYS.HYBRID_APP]: { - readyToSwitchToClassicExperience: useNewDotSignInPage !== 'true', - readyToShowAuthScreens: useNewDotSignInPage !== 'true', - isSigningIn: false, - }, }); }) .then(initAppAfterTransition) diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index cb2c0c677e3f..58d7310e894d 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -3,7 +3,7 @@ import React, {useCallback, useContext, useEffect, useLayoutEffect, useMemo, use // eslint-disable-next-line no-restricted-imports import type {GestureResponderEvent, ScrollView as RNScrollView, ScrollViewProps, StyleProp, ViewStyle} from 'react-native'; import {NativeModules, View} from 'react-native'; -import {useOnyx} from 'react-native-onyx'; +import Onyx, {useOnyx} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import AccountSwitcher from '@components/AccountSwitcher'; import AccountSwitcherSkeletonView from '@components/AccountSwitcherSkeletonView'; @@ -37,7 +37,7 @@ import {hasGlobalWorkspaceSettingsRBR} from '@libs/WorkspacesSettingsUtils'; import * as ReportActionContextMenu from '@pages/home/report/ContextMenu/ReportActionContextMenu'; import variables from '@styles/variables'; import * as App from '@userActions/App'; -import {setShouldResetSigningInLogic} from '@userActions/HybridApp'; +import {setIsSigningIn, setReadyToShowAuthScreens, setReadyToSwitchToClassicExperience, setShouldResetSigningInLogic} from '@userActions/HybridApp'; import * as Link from '@userActions/Link'; import * as PaymentMethods from '@userActions/PaymentMethods'; import * as Session from '@userActions/Session'; @@ -271,6 +271,10 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr icon: Expensicons.Exit, action: () => { setShouldResetSigningInLogic(true); + setReadyToShowAuthScreens(false); + setReadyToSwitchToClassicExperience(false); + setIsSigningIn(false); + Onyx.merge(ONYXKEYS.USE_NEWDOT_SIGN_IN_PAGE, true); signOut(false); }, }, diff --git a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx index 0987f223209d..83efaac1099c 100755 --- a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx +++ b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx @@ -96,10 +96,6 @@ function BaseValidateCodeForm({autoComplete, isUsingRecoveryCode, setIsUsingReco return; } - setReadyToShowAuthScreens(false); - setReadyToSwitchToClassicExperience(false); - setIsSigningIn(false); - Onyx.merge(ONYXKEYS.USE_NEWDOT_SIGN_IN_PAGE, true); setOldDotSignInState(CONST.OLD_DOT_SIGN_IN_STATE.NOT_STARTED); setNewDotSignInState(CONST.NEW_DOT_SIGN_IN_STATE.NOT_STARTED); setShouldResetSigningInLogic(false);