Skip to content

Commit

Permalink
move part of resetting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
war-in committed Oct 31, 2024
1 parent efde805 commit a1b9e1a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
5 changes: 0 additions & 5 deletions src/libs/actions/Session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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);
},
},
Expand Down
4 changes: 0 additions & 4 deletions src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a1b9e1a

Please sign in to comment.