Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HybridApp] Implement POC of NewDot SignIn on HybridApp #51257

Draft
wants to merge 68 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
5eaa292
Implement POC of NewDot login page on HybridApp
mateuuszzzzz Oct 22, 2024
404047f
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Oct 28, 2024
f81ec86
fix android crash
war-in Oct 29, 2024
290748d
add HybridApp onyx key
war-in Oct 29, 2024
05c4573
wip - sending native events
war-in Oct 31, 2024
b6e14aa
Merge branch 'refs/heads/main' into war-in/unmock-signing-in
war-in Oct 31, 2024
bb05ef9
js logic
war-in Oct 31, 2024
94ebb8f
fix switching to new experience
war-in Oct 31, 2024
a9ff586
block switching when still signing in to OD
war-in Oct 31, 2024
ec6315e
reset onyx values on start
war-in Oct 31, 2024
db0d806
Merge branch 'refs/heads/main' into make-new-dot-signin-default-for-h…
war-in Oct 31, 2024
e1562bb
preserve HYBRID_APP onyx key when signing out
war-in Oct 31, 2024
efde805
fix
war-in Oct 31, 2024
a1b9e1a
move part of resetting logic
war-in Oct 31, 2024
3ad1b62
move useNewDotSignInPage to HybridApp key
war-in Nov 4, 2024
f9b0e5a
fix lint & typecheck
war-in Nov 4, 2024
377b686
correctly set onyx props when switching from OD
war-in Nov 4, 2024
90f7c0f
don't set HybridApp key in onyx (merge it)
war-in Nov 4, 2024
4b3e539
send error message on failed OD login
war-in Nov 4, 2024
026ac7b
add useOldDot const
war-in Nov 5, 2024
624be42
Merge branch 'main' into war-in/unmock-signing-in
war-in Nov 6, 2024
44dffc8
Merge branch 'war-in/unmock-signing-in' into make-new-dot-signin-defa…
war-in Nov 6, 2024
d976148
Bootsplash logic in hybridapp (#132)
jnowakow Nov 7, 2024
11e444d
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Nov 12, 2024
a78141d
fix clearing onyx
war-in Nov 13, 2024
deaba6f
[HybridApp] Do not use query params in AppProp URL (#125)
mateuuszzzzz Nov 13, 2024
f2e3bb4
Handle OD sing-in errors (#136)
war-in Nov 13, 2024
8859b6c
add disabled to button
war-in Nov 13, 2024
a3436bc
move sign in state to HybridApp key
war-in Nov 13, 2024
703c31d
add loading indicator and error modal
war-in Nov 14, 2024
1f6a0e1
move sign in logic to HybridApp.ts
war-in Nov 14, 2024
63a3de8
fix lint
war-in Nov 14, 2024
9fdeebb
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
mateuuszzzzz Nov 18, 2024
4bc9f90
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
mateuuszzzzz Nov 20, 2024
1a99fd1
Prevent closing NewDot on first transition with button
mateuuszzzzz Nov 20, 2024
0e601bd
use "tryNewDot" value to determine which app should be opened
war-in Nov 21, 2024
1c0c219
first step to fix deeplinks
war-in Nov 21, 2024
c848cfd
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Nov 27, 2024
4170968
improve openApp flow
war-in Nov 27, 2024
50c3fed
[HybridApp] Clean code (#143)
mateuuszzzzz Nov 27, 2024
fb82b65
[HybridApp] Refactor `SignInPage` PR v2 (#144)
mateuuszzzzz Nov 28, 2024
ecb93e2
fix part of signup flow
war-in Nov 27, 2024
6f926fe
[SignIn Page] New user flow (#145)
war-in Nov 28, 2024
f540207
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Nov 28, 2024
5aae4be
Merge remote-tracking branch 'origin/make-new-dot-signin-default-for-…
war-in Nov 28, 2024
90c0954
fix isSingleNewDotEntry logic (travel feature)
war-in Dec 2, 2024
13180c2
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Dec 2, 2024
ddb9aef
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Dec 5, 2024
9cfbaf5
Rename argument
mateuuszzzzz Dec 5, 2024
85eddb2
Change function name
mateuuszzzzz Dec 5, 2024
bddba03
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Dec 9, 2024
68ed516
Dont sign in in old dot (#150)
war-in Dec 9, 2024
9450d21
clear onyx but leave same data as when signing out
war-in Dec 9, 2024
62b861c
Improve data fetching on OldDot side
mateuuszzzzz Dec 10, 2024
8ea545c
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
mateuuszzzzz Dec 11, 2024
837cbfe
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Dec 13, 2024
892dec2
Add named params in HybridAppModule methods (#153)
war-in Dec 13, 2024
7494419
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Jan 22, 2025
1e113cd
fix after merge
war-in Jan 22, 2025
5f18606
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Jan 22, 2025
3655c4f
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Jan 23, 2025
1cc1cd1
adjust copilot to new sign in flow
war-in Jan 23, 2025
e801e92
Merge branch 'refs/heads/main' into make-new-dot-signin-default-for-h…
war-in Feb 3, 2025
4f3a35e
post-merge fixes
war-in Feb 3, 2025
190ec0d
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
jnowakow Feb 4, 2025
fd1d9c9
Merge branch 'main' into make-new-dot-signin-default-for-hybridapp
war-in Feb 6, 2025
708d8ed
post-merge fixes
war-in Feb 6, 2025
793608f
fix status bar when signing into OldDot
war-in Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {SplashScreenStateContextProvider} from './SplashScreenStateContext';
type AppProps = {
/** URL containing all necessary data to run React Native app (e.g. login data) */
url?: Route;
hybridAppSettings?: string;
};

LogBox.ignoreLogs([
Expand All @@ -62,14 +63,17 @@ const fill = {flex: 1};

const StrictModeWrapper = CONFIG.USE_REACT_STRICT_MODE_IN_DEV ? React.StrictMode : ({children}: {children: React.ReactElement}) => children;

function App({url}: AppProps) {
function App({url, hybridAppSettings}: AppProps) {
useDefaultDragAndDrop();
OnyxUpdateManager();

return (
<StrictModeWrapper>
<SplashScreenStateContextProvider>
<InitialURLContextProvider url={url}>
<InitialURLContextProvider
url={url}
hybridAppSettings={hybridAppSettings}
>
<GestureHandlerRootView style={fill}>
<ComposeProviders
components={[
Expand Down
9 changes: 9 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4841,6 +4841,9 @@ const CONST = {
},
EVENTS: {
SCROLLING: 'scrolling',
HYBRID_APP: {
ON_SIGN_IN_FINISHED: 'onSignInFinished',
},
},

CHAT_HEADER_LOADER_HEIGHT: 36,
Expand Down Expand Up @@ -6456,6 +6459,12 @@ const CONST = {
HIDDEN: `hidden`,
},

HYBRID_APP_SIGN_IN_STATE: {
NOT_STARTED: 'notStarted',
STARTED: 'started',
FINISHED: 'finished',
},

CSV_IMPORT_COLUMNS: {
EMAIL: 'email',
NAME: 'name',
Expand Down
9 changes: 7 additions & 2 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
const [screenShareRequest] = useOnyx(ONYXKEYS.SCREEN_SHARE_REQUEST);
const [focusModeNotification] = useOnyx(ONYXKEYS.FOCUS_MODE_NOTIFICATION, {initWithStoredValues: false});
const [lastVisitedPath] = useOnyx(ONYXKEYS.LAST_VISITED_PATH);
const [hybridApp] = useOnyx(ONYXKEYS.HYBRID_APP);

useEffect(() => {
if (!account?.needsTwoFactorAuthSetup || account.requiresTwoFactorAuth) {
Expand All @@ -115,10 +116,14 @@
const isAuthenticated = useMemo(() => !!(session?.authToken ?? null), [session]);
const autoAuthState = useMemo(() => session?.autoAuthState ?? '', [session]);

const shouldInit = isNavigationReady && hasAttemptedToOpenPublicRoom;
const shouldInit = NativeModules.HybridAppModule
? !hybridApp?.loggedOutFromOldDot && isNavigationReady && hasAttemptedToOpenPublicRoom
: isNavigationReady && hasAttemptedToOpenPublicRoom;
const shouldHideSplash =
shouldInit &&
(NativeModules.HybridAppModule ? splashScreenState === CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN && isAuthenticated : splashScreenState === CONST.BOOT_SPLASH_STATE.VISIBLE);
(NativeModules.HybridAppModule
? splashScreenState === CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN && (isAuthenticated || !!hybridApp?.useNewDotSignInPage)
: splashScreenState === CONST.BOOT_SPLASH_STATE.VISIBLE);

const initializeClient = () => {
if (!Visibility.isVisible()) {
Expand Down Expand Up @@ -234,7 +239,7 @@
if (!isAuthenticated) {
return;
}
setCrashlyticsUserId(session?.accountID ?? -1);

Check failure on line 242 in src/Expensify.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

}, [isAuthenticated, session?.accountID]);

// Display a blank page until the onyx migration completes
Expand Down
7 changes: 3 additions & 4 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,6 @@ const ONYXKEYS = {
/** Stores recently used currencies */
RECENTLY_USED_CURRENCIES: 'nvp_recentlyUsedCurrencies',

/** States whether we transitioned from OldDot to show only certain group of screens. It should be undefined on pure NewDot. */
IS_SINGLE_NEW_DOT_ENTRY: 'isSingleNewDotEntry',

/** Company cards custom names */
NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES: 'nvp_expensify_ccCustomNames',

Expand All @@ -476,6 +473,8 @@ const ONYXKEYS = {
/** Information about travel provisioning process */
TRAVEL_PROVISIONING: 'travelProvisioning',

HYBRID_APP: 'hybridApp',

/** Collection Keys */
COLLECTION: {
DOWNLOAD: 'download_',
Expand Down Expand Up @@ -1064,7 +1063,6 @@ type OnyxValuesMapping = {
[ONYXKEYS.APPROVAL_WORKFLOW]: OnyxTypes.ApprovalWorkflowOnyx;
[ONYXKEYS.IMPORTED_SPREADSHEET]: OnyxTypes.ImportedSpreadsheet;
[ONYXKEYS.LAST_ROUTE]: string;
[ONYXKEYS.IS_SINGLE_NEW_DOT_ENTRY]: boolean | undefined;
[ONYXKEYS.IS_USING_IMPORTED_STATE]: boolean;
[ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES]: Record<string, string>;
[ONYXKEYS.CONCIERGE_REPORT_ID]: string;
Expand All @@ -1074,6 +1072,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.CORPAY_ONBOARDING_FIELDS]: OnyxTypes.CorpayOnboardingFields;
[ONYXKEYS.LAST_FULL_RECONNECT_TIME]: string;
[ONYXKEYS.TRAVEL_PROVISIONING]: OnyxTypes.TravelProvisioning;
[ONYXKEYS.HYBRID_APP]: OnyxTypes.HybridApp;
};
type OnyxValues = OnyxValuesMapping & OnyxCollectionValuesMapping & OnyxFormValuesMapping & OnyxFormDraftValuesMapping;

Expand Down
17 changes: 8 additions & 9 deletions src/components/BookTravelButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Str} from 'expensify-common';
import React, {useCallback, useContext, useState} from 'react';
import React, {useCallback, useState} from 'react';
import {NativeModules} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import useLocalize from '@hooks/useLocalize';
Expand All @@ -10,12 +10,12 @@ import {cleanupTravelProvisioningSession} from '@libs/actions/Travel';
import Log from '@libs/Log';
import Navigation from '@libs/Navigation/Navigation';
import {getAdminsPrivateEmailDomains} from '@libs/PolicyUtils';
import {setIsRootStatusBarEnabled} from '@userActions/HybridApp';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import Button from './Button';
import CustomStatusBarAndBackgroundContext from './CustomStatusBarAndBackground/CustomStatusBarAndBackgroundContext';
import DotIndicatorMessage from './DotIndicatorMessage';

type BookTravelButtonProps = {
Expand All @@ -37,11 +37,10 @@ function BookTravelButton({text}: BookTravelButtonProps) {
const [travelSettings] = useOnyx(ONYXKEYS.NVP_TRAVEL_SETTINGS);
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
const primaryLogin = account?.primaryLogin;
const {setRootStatusBarEnabled} = useContext(CustomStatusBarAndBackgroundContext);

// Flag indicating whether NewDot was launched exclusively for Travel,
// e.g., when the user selects "Trips" from the Expensify Classic menu in HybridApp.
const [wasNewDotLaunchedJustForTravel] = useOnyx(ONYXKEYS.IS_SINGLE_NEW_DOT_ENTRY);
const [hybridApp] = useOnyx(ONYXKEYS.HYBRID_APP);

const bookATrip = useCallback(() => {
setErrorMessage('');
Expand All @@ -63,15 +62,15 @@ function BookTravelButton({text}: BookTravelButtonProps) {
openTravelDotLink(policy?.id)
?.then(() => {
// When a user selects "Trips" in the Expensify Classic menu, the HybridApp opens the ManageTrips page in NewDot.
// The wasNewDotLaunchedJustForTravel flag indicates if NewDot was launched solely for this purpose.
if (!NativeModules.HybridAppModule || !wasNewDotLaunchedJustForTravel) {
// The isSingleNewDotEntry flag indicates if NewDot was launched solely for this purpose.
if (!NativeModules.HybridAppModule || !hybridApp?.isSingleNewDotEntry) {
return;
}

// Close NewDot if it was opened only for Travel, as its purpose is now fulfilled.
Log.info('[HybridApp] Returning to OldDot after opening TravelDot');
NativeModules.HybridAppModule.closeReactNativeApp(false, false);
setRootStatusBarEnabled(false);
NativeModules.HybridAppModule.closeReactNativeApp({shouldSignOut: false, shouldSetNVP: false});
setIsRootStatusBarEnabled(false);
})
?.catch(() => {
setErrorMessage(translate('travel.errorMessage'));
Expand All @@ -92,7 +91,7 @@ function BookTravelButton({text}: BookTravelButtonProps) {
Navigation.navigate(ROUTES.TRAVEL_DOMAIN_SELECTOR);
}
}
}, [policy, wasNewDotLaunchedJustForTravel, travelSettings, translate, primaryLogin, setRootStatusBarEnabled]);
}, [primaryLogin, policy, travelSettings?.hasAcceptedTerms, translate, hybridApp?.isSingleNewDotEntry]);

return (
<>
Expand Down
5 changes: 4 additions & 1 deletion src/components/CustomStatusBarAndBackground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import useTheme from '@hooks/useTheme';
import {navigationRef} from '@libs/Navigation/Navigation';
import StatusBar from '@libs/StatusBar';
import type {StatusBarStyle} from '@styles/index';
import ONYXKEYS from '@src/ONYXKEYS';
import {useOnyx} from '../../../__mocks__/react-native-onyx';
import CustomStatusBarAndBackgroundContext from './CustomStatusBarAndBackgroundContext';
import updateGlobalBackgroundColor from './updateGlobalBackgroundColor';
import updateStatusBarAppearance from './updateStatusBarAppearance';
Expand All @@ -19,8 +21,9 @@ function CustomStatusBarAndBackground({isNested = false}: CustomStatusBarAndBack
const {isRootStatusBarEnabled, setRootStatusBarEnabled} = useContext(CustomStatusBarAndBackgroundContext);
const theme = useTheme();
const [statusBarStyle, setStatusBarStyle] = useState<StatusBarStyle>();
const [hybridApp] = useOnyx(ONYXKEYS.HYBRID_APP);

const isDisabled = !isNested && !isRootStatusBarEnabled;
const isDisabled = (!hybridApp?.isRootStatusBarEnabled ?? false) || (!isNested && !isRootStatusBarEnabled);

// Disable the root status bar when a nested status bar is rendered
useEffect(() => {
Expand Down
35 changes: 23 additions & 12 deletions src/components/InitialURLContextProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import React, {createContext, useEffect, useMemo, useState} from 'react';
import React, {createContext, useEffect, useMemo, useRef, useState} from 'react';
import type {ReactNode} from 'react';
import {Linking} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import {signInAfterTransitionFromOldDot} from '@libs/actions/Session';
import {setupNewDotAfterTransitionFromOldDot} from '@libs/actions/Session';
import Navigation from '@navigation/Navigation';
import {setIsRootStatusBarEnabled} from '@userActions/HybridApp';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Route} from '@src/ROUTES';
import {useSplashScreenStateContext} from '@src/SplashScreenStateContext';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

type InitialUrlContextType = {
initialURL: Route | undefined;
Expand All @@ -25,14 +27,19 @@ type InitialURLContextProviderProps = {
/** URL passed to our top-level React Native component by HybridApp. Will always be undefined in "pure" NewDot builds. */
url?: Route | ValueOf<typeof CONST.HYBRID_APP>;

hybridAppSettings?: string;

/** Children passed to the context provider */
children: ReactNode;
};

function InitialURLContextProvider({children, url}: InitialURLContextProviderProps) {
const [initialURL, setInitialURL] = useState<Route | undefined>();
function InitialURLContextProvider({children, url, hybridAppSettings}: InitialURLContextProviderProps) {
const [initialURL, setInitialURL] = useState<Route | ValueOf<typeof CONST.HYBRID_APP> | undefined>(url);
const [lastVisitedPath] = useOnyx(ONYXKEYS.LAST_VISITED_PATH);
const {splashScreenState, setSplashScreenState} = useSplashScreenStateContext();
const [tryNewDot, tryNewDotMetadata] = useOnyx(ONYXKEYS.NVP_TRYNEWDOT);
// We use `setupCalled` ref to guarantee that `signInAfterTransitionFromOldDot` is called once.
const setupCalled = useRef(false);

useEffect(() => {
if (url !== CONST.HYBRID_APP.REORDERING_REACT_NATIVE_ACTIVITY_TO_FRONT) {
Expand All @@ -50,22 +57,26 @@ function InitialURLContextProvider({children, url}: InitialURLContextProviderPro
return;
}

if (url) {
signInAfterTransitionFromOldDot(url).then((route) => {
setInitialURL(route);
setSplashScreenState(CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN);
});
setIsRootStatusBarEnabled(true);
if (url && hybridAppSettings) {
if (!isLoadingOnyxValue(tryNewDotMetadata) && !setupCalled.current) {
setupCalled.current = true;
setupNewDotAfterTransitionFromOldDot(url, hybridAppSettings, tryNewDot).then((route) => {
setInitialURL(route);
setSplashScreenState(CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN);
});
}
return;
}
Linking.getInitialURL().then((initURL) => {
setInitialURL(initURL as Route);
});
}, [setSplashScreenState, url]);
}, [hybridAppSettings, setSplashScreenState, tryNewDot, tryNewDotMetadata, url]);

const initialUrlContext = useMemo(
() => ({
initialURL,
setInitialURL,
initialURL: initialURL === CONST.HYBRID_APP.REORDERING_REACT_NATIVE_ACTIVITY_TO_FRONT ? undefined : initialURL,
setInitialURL: setInitialURL as React.Dispatch<React.SetStateAction<Route | undefined>>,
}),
[initialURL],
);
Expand Down
7 changes: 3 additions & 4 deletions src/components/ScreenWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import {isMobile, isMobileWebKit, isSafari} from '@libs/Browser';
import type {PlatformStackNavigationProp} from '@libs/Navigation/PlatformStackNavigation/types';
import type {AuthScreensParamList, RootStackParamList} from '@libs/Navigation/types';
import addViewportResizeListener from '@libs/VisualViewport';
import {setIsRootStatusBarEnabled} from '@userActions/HybridApp';
import toggleTestToolsModal from '@userActions/TestTool';
import CONST from '@src/CONST';
import CustomDevMenu from './CustomDevMenu';
import CustomStatusBarAndBackgroundContext from './CustomStatusBarAndBackground/CustomStatusBarAndBackgroundContext';
import FocusTrapForScreens from './FocusTrap/FocusTrapForScreen';
import type FocusTrapForScreenProps from './FocusTrap/FocusTrapForScreen/FocusTrapProps';
import HeaderGap from './HeaderGap';
Expand Down Expand Up @@ -153,7 +153,6 @@ function ScreenWrapper(
const {windowHeight} = useWindowDimensions(shouldUseCachedViewportHeight);
// since Modals are drawn in separate native view hierarchy we should always add paddings
const ignoreInsetsConsumption = !useContext(ModalContext).default;
const {setRootStatusBarEnabled} = useContext(CustomStatusBarAndBackgroundContext);

// We need to use isSmallScreenWidth instead of shouldUseNarrowLayout for a case where we want to show the offline indicator only on small screens
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
Expand All @@ -172,8 +171,8 @@ function ScreenWrapper(
const {isBlurred, setIsBlurred} = useInputBlurContext();

UNSTABLE_usePreventRemove(shouldReturnToOldDot, () => {
NativeModules.HybridAppModule?.closeReactNativeApp(false, false);
setRootStatusBarEnabled(false);
NativeModules.HybridAppModule?.closeReactNativeApp({shouldSignOut: false, shouldSetNVP: false});
setIsRootStatusBarEnabled(false);
});

const panResponder = useRef(
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useOnboardingFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import {useOnyx} from 'react-native-onyx';
import Navigation from '@libs/Navigation/Navigation';
import {hasCompletedGuidedSetupFlowSelector, tryNewDotOnyxSelector} from '@libs/onboardingSelectors';
import * as SearchQueryUtils from '@libs/SearchQueryUtils';

Check failure on line 6 in src/hooks/useOnboardingFlow.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import * as Session from '@userActions/Session';

Check failure on line 7 in src/hooks/useOnboardingFlow.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @userActions are not allowed. Use named imports instead. Example: import { action } from "@userActions/module"
import * as OnboardingFlow from '@userActions/Welcome/OnboardingFlow';

Check failure on line 8 in src/hooks/useOnboardingFlow.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @userActions are not allowed. Use named imports instead. Example: import { action } from "@userActions/module"
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
Expand All @@ -29,7 +29,7 @@

const isPrivateDomain = Session.isUserOnPrivateDomain();

const [isSingleNewDotEntry, isSingleNewDotEntryMetadata] = useOnyx(ONYXKEYS.IS_SINGLE_NEW_DOT_ENTRY);
const [isSingleNewDotEntry, isSingleNewDotEntryMetadata] = useOnyx(ONYXKEYS.HYBRID_APP, {selector: (data) => data?.isSingleNewDotEntry});
useEffect(() => {
// This should delay opening the onboarding modal so it does not interfere with the ongoing ReportScreen params changes
InteractionManager.runAfterInteractions(() => {
Expand Down
8 changes: 4 additions & 4 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const WRITE_COMMANDS = {
REQUEST_NEW_VALIDATE_CODE: 'RequestNewValidateCode',
SIGN_IN_WITH_APPLE: 'SignInWithApple',
SIGN_IN_WITH_GOOGLE: 'SignInWithGoogle',
SIGN_IN_USER: 'SigninUser',
SIGN_IN_USER_WITH_LINK: 'SigninUserWithLink',
SEARCH: 'Search',
REQUEST_UNLINK_VALIDATION_LINK: 'RequestUnlinkValidationLink',
Expand Down Expand Up @@ -312,7 +311,6 @@ const WRITE_COMMANDS = {
TRANSACTION_MERGE: 'Transaction_Merge',
RESOLVE_DUPLICATES: 'ResolveDuplicates',
UPDATE_SUBSCRIPTION_TYPE: 'UpdateSubscriptionType',
SIGN_UP_USER: 'SignUpUser',
UPDATE_SUBSCRIPTION_AUTO_RENEW: 'UpdateSubscriptionAutoRenew',
UPDATE_SUBSCRIPTION_ADD_NEW_USERS_AUTOMATICALLY: 'UpdateSubscriptionAddNewUsersAutomatically',
UPDATE_SUBSCRIPTION_SIZE: 'UpdateSubscriptionSize',
Expand Down Expand Up @@ -537,7 +535,6 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.REQUEST_NEW_VALIDATE_CODE]: Parameters.RequestNewValidateCodeParams;
[WRITE_COMMANDS.SIGN_IN_WITH_APPLE]: Parameters.BeginAppleSignInParams;
[WRITE_COMMANDS.SIGN_IN_WITH_GOOGLE]: Parameters.BeginGoogleSignInParams;
[WRITE_COMMANDS.SIGN_IN_USER]: SignInUserParams;
[WRITE_COMMANDS.SIGN_IN_USER_WITH_LINK]: Parameters.SignInUserWithLinkParams;
[WRITE_COMMANDS.REQUEST_UNLINK_VALIDATION_LINK]: Parameters.RequestUnlinkValidationLinkParams;
[WRITE_COMMANDS.UNLINK_LOGIN]: Parameters.UnlinkLoginParams;
Expand Down Expand Up @@ -781,7 +778,6 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.TRANSACTION_MERGE]: Parameters.TransactionMergeParams;
[WRITE_COMMANDS.RESOLVE_DUPLICATES]: Parameters.ResolveDuplicatesParams;
[WRITE_COMMANDS.UPDATE_SUBSCRIPTION_TYPE]: Parameters.UpdateSubscriptionTypeParams;
[WRITE_COMMANDS.SIGN_UP_USER]: Parameters.SignUpUserParams;
[WRITE_COMMANDS.UPDATE_SUBSCRIPTION_AUTO_RENEW]: Parameters.UpdateSubscriptionAutoRenewParams;
[WRITE_COMMANDS.UPDATE_SUBSCRIPTION_ADD_NEW_USERS_AUTOMATICALLY]: Parameters.UpdateSubscriptionAddNewUsersAutomaticallyParams;
[WRITE_COMMANDS.UPDATE_SUBSCRIPTION_SIZE]: Parameters.UpdateSubscriptionSizeParams;
Expand Down Expand Up @@ -1081,6 +1077,8 @@ const SIDE_EFFECT_REQUEST_COMMANDS = {
COMPLETE_HYBRID_APP_ONBOARDING: 'CompleteHybridAppOnboarding',
CONNECT_POLICY_TO_QUICKBOOKS_DESKTOP: 'ConnectPolicyToQuickbooksDesktop',
BANK_ACCOUNT_CREATE_CORPAY: 'BankAccount_CreateCorpay',
SIGN_IN_USER: 'SigninUser',
SIGN_UP_USER: 'SignUpUser',

// PayMoneyRequestOnSearch only works online (pattern C) and we need to play the success sound only when the request is successful
PAY_MONEY_REQUEST_ON_SEARCH: 'PayMoneyRequestOnSearch',
Expand All @@ -1104,6 +1102,8 @@ type SideEffectRequestCommandParameters = {
[SIDE_EFFECT_REQUEST_COMMANDS.COMPLETE_HYBRID_APP_ONBOARDING]: EmptyObject;
[SIDE_EFFECT_REQUEST_COMMANDS.CONNECT_POLICY_TO_QUICKBOOKS_DESKTOP]: Parameters.ConnectPolicyToQuickBooksDesktopParams;
[SIDE_EFFECT_REQUEST_COMMANDS.BANK_ACCOUNT_CREATE_CORPAY]: Parameters.BankAccountCreateCorpayParams;
[SIDE_EFFECT_REQUEST_COMMANDS.SIGN_IN_USER]: SignInUserParams;
[SIDE_EFFECT_REQUEST_COMMANDS.SIGN_UP_USER]: Parameters.SignUpUserParams;
[SIDE_EFFECT_REQUEST_COMMANDS.PAY_MONEY_REQUEST_ON_SEARCH]: Parameters.PayMoneyRequestOnSearchParams;
};

Expand Down
Loading
Loading