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

Fix show onboarding modal functions #44536

Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3438e76
Fix show onboarding modal functions
filip-solecki Jun 27, 2024
0b0ece6
Add util function to check if screen is from onboarding flow
zfurtak Jun 27, 2024
4b7b93a
Added back navigation blocking from onboarding screens
zfurtak Jun 27, 2024
4a31c72
Fix TS errors
filip-solecki Jun 28, 2024
1ce3c51
Merge branch 'main' into filip-solecki/dismissing-onboarding
filip-solecki Jun 28, 2024
f916987
Fix lint
filip-solecki Jun 28, 2024
6a36309
Move error to onyx to handle back button errors
filip-solecki Jun 28, 2024
f4d9eb7
Merge branch 'main' into filip-solecki/dismissing-onboarding
filip-solecki Jul 1, 2024
f785748
Add translations
filip-solecki Jul 1, 2024
32084b6
generate onboarding state for initial state
adamgrzybowski Jul 2, 2024
ca9dfe9
improve redirecting to onboarding after logging in
adamgrzybowski Jul 2, 2024
db1d22a
prevent deeplinks if user should see onboarding after login
adamgrzybowski Jul 2, 2024
9422f48
Merge branch 'main' into filip-solecki/dismissing-onboarding
adamgrzybowski Jul 2, 2024
5e6f56a
move useDisableModalDismissOnEscape to top level onboarding navigator
adamgrzybowski Jul 4, 2024
1920968
Merge branch 'main' into filip-solecki/dismissing-onboarding
adamgrzybowski Jul 4, 2024
e2598f2
Add confirmed translation
filip-solecki Jul 4, 2024
4c35ff1
Fix lint
filip-solecki Jul 4, 2024
3079bc7
Fix jest tests
filip-solecki Jul 5, 2024
9eb7286
Merge branch 'main' into filip-solecki/dismissing-onboarding
filip-solecki Jul 5, 2024
063373d
apply CR suggestions
filip-solecki Jul 5, 2024
30344f3
Fix focus on Purpose page
filip-solecki Jul 8, 2024
fd1e2ec
Merge branch 'main' into filip-solecki/dismissing-onboarding
adamgrzybowski Jul 9, 2024
84075e4
Fix english text
filip-solecki Jul 9, 2024
ed75b69
Fix comments styling
filip-solecki Jul 9, 2024
7316347
add hasCompletedGuidedSetupFlowSelector
adamgrzybowski Jul 9, 2024
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
4 changes: 4 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ const ONYXKEYS = {
/** Onboarding Purpose selected by the user during Onboarding flow */
ONBOARDING_PURPOSE_SELECTED: 'onboardingPurposeSelected',

/** Onboarding error message to be displayed to the user */
ONBOARDING_ERROR_MESSAGE: 'onboardingErrorMessage',

/** Onboarding policyID selected by the user during Onboarding flow */
ONBOARDING_POLICY_ID: 'onboardingPolicyID',

Expand Down Expand Up @@ -737,6 +740,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.MAX_CANVAS_HEIGHT]: number;
[ONYXKEYS.MAX_CANVAS_WIDTH]: number;
[ONYXKEYS.ONBOARDING_PURPOSE_SELECTED]: string;
[ONYXKEYS.ONBOARDING_ERROR_MESSAGE]: string;
[ONYXKEYS.ONBOARDING_POLICY_ID]: string;
[ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID]: string;
[ONYXKEYS.IS_SEARCHING_FOR_REPORTS]: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ export default {
title: 'What do you want to do today?',
errorSelection: 'Please make a selection to continue.',
errorContinue: 'Please press continue to get set up.',
errorBackButton: 'Finish onboarding so you can use the app.',
filip-solecki marked this conversation as resolved.
Show resolved Hide resolved
mountiny marked this conversation as resolved.
Show resolved Hide resolved
[CONST.ONBOARDING_CHOICES.EMPLOYER]: 'Get paid back by my employer',
[CONST.ONBOARDING_CHOICES.MANAGE_TEAM]: "Manage my team's expenses",
[CONST.ONBOARDING_CHOICES.PERSONAL_SPEND]: 'Track and budget expenses',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,7 @@ export default {
title: '¿Qué quieres hacer hoy?',
errorSelection: 'Por favor selecciona una opción para continuar.',
errorContinue: 'Por favor, haz click en continuar para configurar tu cuenta.',
errorBackButton: 'Finalizar la integración para poder utilizar la aplicación.',
filip-solecki marked this conversation as resolved.
Show resolved Hide resolved
[CONST.ONBOARDING_CHOICES.EMPLOYER]: 'Cobrar de mi empresa',
[CONST.ONBOARDING_CHOICES.MANAGE_TEAM]: 'Gestionar los gastos de mi equipo',
[CONST.ONBOARDING_CHOICES.PERSONAL_SPEND]: 'Controlar y presupuestar gastos',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import getTopmostBottomTabRoute from '@libs/Navigation/getTopmostBottomTabRoute'
import getTopmostCentralPaneRoute from '@libs/Navigation/getTopmostCentralPaneRoute';
import Navigation from '@libs/Navigation/Navigation';
import type {RootStackParamList, State} from '@libs/Navigation/types';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import {getChatTabBrickRoad} from '@libs/WorkspacesSettingsUtils';
import BottomTabAvatar from '@pages/home/sidebar/BottomTabAvatar';
import BottomTabBarFloatingActionButton from '@pages/home/sidebar/BottomTabBarFloatingActionButton';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import getTopmostBottomTabRoute from '@libs/Navigation/getTopmostBottomTabRoute'
import getTopmostCentralPaneRoute from '@libs/Navigation/getTopmostCentralPaneRoute';
import Navigation from '@libs/Navigation/Navigation';
import type {RootStackParamList, State} from '@libs/Navigation/types';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import {getChatTabBrickRoad} from '@libs/WorkspacesSettingsUtils';
import BottomTabAvatar from '@pages/home/sidebar/BottomTabAvatar';
import BottomTabBarFloatingActionButton from '@pages/home/sidebar/BottomTabBarFloatingActionButton';
Expand Down Expand Up @@ -53,7 +53,12 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps
return;
}

Welcome.isOnboardingFlowCompleted({onNotCompleted: () => Navigation.navigate(ROUTES.ONBOARDING_ROOT)});
Welcome.isOnboardingFlowCompleted({
onNotCompleted: () => {
Navigation.dismissModal();
Navigation.navigate(ROUTES.ONBOARDING_PURPOSE);
},
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLoadingApp]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import type {RouterConfigOptions, StackNavigationState} from '@react-navigation/native';
import {getPathFromState, StackRouter} from '@react-navigation/native';
import type {CommonActions, RouterConfigOptions, StackActionType, StackNavigationState} from '@react-navigation/native';
import {findFocusedRoute, getPathFromState, StackRouter} from '@react-navigation/native';
import type {ParamListBase} from '@react-navigation/routers';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
import * as Localize from '@libs/Localize';
import getTopmostBottomTabRoute from '@libs/Navigation/getTopmostBottomTabRoute';
import getTopmostCentralPaneRoute from '@libs/Navigation/getTopmostCentralPaneRoute';
import linkingConfig from '@libs/Navigation/linkingConfig';
import getAdaptedStateFromPath from '@libs/Navigation/linkingConfig/getAdaptedStateFromPath';
import type {NavigationPartialRoute, RootStackParamList, State} from '@libs/Navigation/types';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName, isOnboardingFlowName} from '@libs/NavigationUtils';
import * as Welcome from '@userActions/Welcome';
import NAVIGATORS from '@src/NAVIGATORS';
import SCREENS from '@src/SCREENS';
import type {ResponsiveStackNavigatorRouterOptions} from './types';
Expand Down Expand Up @@ -97,6 +99,22 @@ function compareAndAdaptState(state: StackNavigationState<RootStackParamList>) {
}
}

function shouldPreventReset(state: StackNavigationState<ParamListBase>, action: CommonActions.Action | StackActionType) {
if (action.type !== 'RESET' || !action?.payload) {
return false;
filip-solecki marked this conversation as resolved.
Show resolved Hide resolved
}
const currentFocusedRoute = findFocusedRoute(state);
const targetFocusedRoute = findFocusedRoute(action?.payload);
// We want to prevent the user from navigating back to a non-onboarding screen if they are currently on an onboarding screen
if (isOnboardingFlowName(currentFocusedRoute?.name) && !isOnboardingFlowName(targetFocusedRoute?.name)) {
mountiny marked this conversation as resolved.
Show resolved Hide resolved
Welcome.setOnboardingErrorMessage(Localize.translateLocal('onboarding.purpose.errorBackButton'));
// We reset the URL as the browser sets it in a way that doesn't match the navigation state
// eslint-disable-next-line no-restricted-globals
history.replaceState({}, '', getPathFromState(state, linkingConfig.config));
return true;
}
}

function CustomRouter(options: ResponsiveStackNavigatorRouterOptions) {
const stackRouter = StackRouter(options);

Expand All @@ -107,6 +125,12 @@ function CustomRouter(options: ResponsiveStackNavigatorRouterOptions) {
const state = stackRouter.getRehydratedState(partialState, {routeNames, routeParamList, routeGetIdList});
return state;
},
getStateForAction(state: StackNavigationState<ParamListBase>, action: CommonActions.Action | StackActionType, configOptions: RouterConfigOptions) {
if (shouldPreventReset(state, action)) {
return state;
}
return stackRouter.getStateForAction(state, action, configOptions);
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import useWindowDimensions from '@hooks/useWindowDimensions';
import getTopmostCentralPaneRoute from '@libs/Navigation/getTopmostCentralPaneRoute';
import navigationRef from '@libs/Navigation/navigationRef';
import type {RootStackParamList, State} from '@libs/Navigation/types';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import SCREENS from '@src/SCREENS';
import CustomRouter from './CustomRouter';
import type {ResponsiveStackNavigatorProps, ResponsiveStackNavigatorRouterOptions} from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {CommonActions, getPathFromState, StackActions} from '@react-navigation/n
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import Log from '@libs/Log';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import * as ReportUtils from '@libs/ReportUtils';
import CONST from '@src/CONST';
import NAVIGATORS from '@src/NAVIGATORS';
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/dismissModalWithReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {StackActions} from '@react-navigation/native';
import {findLastIndex} from 'lodash';
import type {OnyxEntry} from 'react-native-onyx';
import Log from '@libs/Log';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import getPolicyEmployeeAccountIDs from '@libs/PolicyEmployeeListUtils';
import {doesReportBelongToWorkspace} from '@libs/ReportUtils';
import NAVIGATORS from '@src/NAVIGATORS';
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/getTopmostCentralPaneRoute.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import type {CentralPaneName, NavigationPartialRoute, RootStackParamList, State} from './types';

// Get the name of topmost central pane route in the navigation stack.
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/getTopmostReportActionID.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {NavigationState, PartialState} from '@react-navigation/native';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import SCREENS from '@src/SCREENS';
import type {RootStackParamList} from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/getTopmostReportId.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {NavigationState, PartialState} from '@react-navigation/native';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import SCREENS from '@src/SCREENS';
import type {RootStackParamList} from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/linkTo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {findFocusedRoute} from '@react-navigation/native';
import {omitBy} from 'lodash';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
import extractPolicyIDsFromState from '@libs/Navigation/linkingConfig/extractPolicyIDsFromState';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import shallowCompare from '@libs/ObjectUtils';
import {extractPolicyIDFromPath, getPathWithoutPolicyID} from '@libs/PolicyUtils';
import getActionsFromPartialDiff from '@navigation/AppNavigator/getActionsFromPartialDiff';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {TupleToUnion} from 'type-fest';
import {isAnonymousUser} from '@libs/actions/Session';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
import type {BottomTabName, CentralPaneName, FullScreenName, NavigationPartialRoute, RootStackParamList} from '@libs/Navigation/types';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import {extractPolicyIDFromPath, getPathWithoutPolicyID} from '@libs/PolicyUtils';
import CONST from '@src/CONST';
import NAVIGATORS from '@src/NAVIGATORS';
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/switchPolicyID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {NavigationAction, NavigationContainerRef, NavigationState, PartialS
import {getPathFromState} from '@react-navigation/native';
import type {Writable} from 'type-fest';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
import isCentralPaneName from '@libs/NavigationUtils';
import {isCentralPaneName} from '@libs/NavigationUtils';
import CONST from '@src/CONST';
import type {Route} from '@src/ROUTES';
import ROUTES from '@src/ROUTES';
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,8 @@ type FullScreenName = keyof FullScreenNavigatorParamList;

type CentralPaneName = keyof CentralPaneScreensParamList;

type OnboardingFlowName = keyof OnboardingModalNavigatorParamList;

type SwitchPolicyIDParams = {
policyID?: string;
route?: Routes;
Expand Down Expand Up @@ -1017,6 +1019,7 @@ export type {
NewChatNavigatorParamList,
NewTaskNavigatorParamList,
OnboardingModalNavigatorParamList,
OnboardingFlowName,
ParticipantsNavigatorParamList,
PrivateNotesNavigatorParamList,
ProfileNavigatorParamList,
Expand Down
14 changes: 12 additions & 2 deletions src/libs/NavigationUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SCREENS from '@src/SCREENS';
import type {CentralPaneName} from './Navigation/types';
import type {CentralPaneName, OnboardingFlowName} from './Navigation/types';

const CENTRAL_PANE_SCREEN_NAMES = new Set([
SCREENS.SETTINGS.WORKSPACES,
Expand All @@ -15,6 +15,8 @@ const CENTRAL_PANE_SCREEN_NAMES = new Set([
SCREENS.REPORT,
]);

const ONBOARDING_SCREEN_NAMES = new Set([SCREENS.ONBOARDING.PERSONAL_DETAILS, SCREENS.ONBOARDING.PURPOSE, SCREENS.ONBOARDING.WORK, SCREENS.ONBOARDING_MODAL.ONBOARDING]);

function isCentralPaneName(screen: string | undefined): screen is CentralPaneName {
if (!screen) {
return false;
Expand All @@ -23,4 +25,12 @@ function isCentralPaneName(screen: string | undefined): screen is CentralPaneNam
return CENTRAL_PANE_SCREEN_NAMES.has(screen as CentralPaneName);
}

export default isCentralPaneName;
function isOnboardingFlowName(screen: string | undefined): screen is OnboardingFlowName {
if (!screen) {
return false;
}

return ONBOARDING_SCREEN_NAMES.has(screen as OnboardingFlowName);
}

export {isCentralPaneName, isOnboardingFlowName};
11 changes: 10 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {findFocusedRoute} from '@react-navigation/native';
import {format as timezoneFormat, utcToZonedTime} from 'date-fns-tz';
import {ExpensiMark, Str} from 'expensify-common';
import isEmpty from 'lodash/isEmpty';
Expand Down Expand Up @@ -58,7 +59,8 @@ import * as ErrorUtils from '@libs/ErrorUtils';
import isPublicScreenRoute from '@libs/isPublicScreenRoute';
import * as Localize from '@libs/Localize';
import Log from '@libs/Log';
import Navigation from '@libs/Navigation/Navigation';
import Navigation, {navigationRef} from '@libs/Navigation/Navigation';
import {isOnboardingFlowName} from '@libs/NavigationUtils';
import type {NetworkStatus} from '@libs/NetworkConnection';
import LocalNotification from '@libs/Notification/LocalNotification';
import {parseHtmlToMarkdown, parseHtmlToText} from '@libs/OnyxAwareParser';
Expand Down Expand Up @@ -2546,10 +2548,17 @@ function openReportFromDeepLink(url: string) {
return;
}

const state = navigationRef.getRootState();
const currentFocusedRoute = findFocusedRoute(state);
if (shouldSkipDeepLinkNavigation(route)) {
return;
}

if (isOnboardingFlowName(currentFocusedRoute?.name)) {
Welcome.setOnboardingErrorMessage(Localize.translateLocal('onboarding.purpose.errorBackButton'));
return;
}

if (isAuthenticated) {
return;
}
Expand Down
38 changes: 13 additions & 25 deletions src/libs/actions/Welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import type Onboarding from '@src/types/onyx/Onboarding';
import type OnyxPolicy from '@src/types/onyx/Policy';
import type TryNewDot from '@src/types/onyx/TryNewDot';

let onboarding: Onboarding | [] | undefined;
type OnboardingData = Onboarding | [] | undefined;

let isLoadingReportData = true;
let tryNewDotData: TryNewDot | undefined;

Expand All @@ -31,8 +32,8 @@ let isServerDataReadyPromise = new Promise<void>((resolve) => {
resolveIsReadyPromise = resolve;
});

let resolveOnboardingFlowStatus: (value?: Promise<void>) => void | undefined;
let isOnboardingFlowStatusKnownPromise = new Promise<void>((resolve) => {
let resolveOnboardingFlowStatus: (value?: OnboardingData) => void;
let isOnboardingFlowStatusKnownPromise = new Promise<OnboardingData>((resolve) => {
resolveOnboardingFlowStatus = resolve;
});

Expand All @@ -46,7 +47,7 @@ function onServerDataReady(): Promise<void> {
}

function isOnboardingFlowCompleted({onCompleted, onNotCompleted}: HasCompletedOnboardingFlowProps) {
isOnboardingFlowStatusKnownPromise.then(() => {
isOnboardingFlowStatusKnownPromise.then((onboarding) => {
if (Array.isArray(onboarding) || onboarding?.hasCompletedGuidedSetupFlow === undefined) {
return;
}
Expand Down Expand Up @@ -103,23 +104,8 @@ function handleHybridAppOnboarding() {
}

/**
* Check that a few requests have completed so that the welcome action can proceed:
*
* - Whether we are a first time new expensify user
* - Whether we have loaded all policies the server knows about
* - Whether we have loaded all reports the server knows about
* Check if onboarding data is ready in order to check if the user has completed onboarding or not
*/
function checkOnboardingDataReady() {
if (onboarding === undefined) {
return;
}

resolveOnboardingFlowStatus?.();
}

/**
* Check if user dismissed modal and if report data are loaded
* Check if report data are loaded
mountiny marked this conversation as resolved.
Show resolved Hide resolved
*/
function checkServerDataReady() {
if (isLoadingReportData) {
Expand All @@ -144,6 +130,10 @@ function setOnboardingPurposeSelected(value: OnboardingPurposeType) {
Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, value ?? null);
}

function setOnboardingErrorMessage(value: string) {
Onyx.set(ONYXKEYS.ONBOARDING_ERROR_MESSAGE, value ?? null);
}

function setOnboardingAdminsChatReportID(adminsChatReportID?: string) {
Onyx.set(ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID, adminsChatReportID ?? null);
}
Expand Down Expand Up @@ -187,9 +177,7 @@ Onyx.connect({
return;
}

onboarding = value;

checkOnboardingDataReady();
resolveOnboardingFlowStatus(value);
},
});

Expand Down Expand Up @@ -231,10 +219,9 @@ function resetAllChecks() {
isServerDataReadyPromise = new Promise((resolve) => {
resolveIsReadyPromise = resolve;
});
isOnboardingFlowStatusKnownPromise = new Promise((resolve) => {
isOnboardingFlowStatusKnownPromise = new Promise<OnboardingData>((resolve) => {
resolveOnboardingFlowStatus = resolve;
});
onboarding = undefined;
isLoadingReportData = true;
}

Expand All @@ -247,4 +234,5 @@ export {
setOnboardingPolicyID,
completeHybridAppOnboarding,
handleHybridAppOnboarding,
setOnboardingErrorMessage,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useState} from 'react';
import React, {useCallback, useEffect, useState} from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import FormProvider from '@components/Form/FormProvider';
Expand Down Expand Up @@ -42,6 +42,10 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat

useDisableModalDismissOnEscape();

useEffect(() => {
Welcome.setOnboardingErrorMessage('');
}, []);

const completeEngagement = useCallback(
(values: FormOnyxValues<'onboardingPersonalDetailsForm'>) => {
const firstName = values.firstName.trim();
Expand Down
Loading
Loading