-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Redirect user to concierge when onboarding completed #42087
Changes from 2 commits
2edff29
efc236a
3dfb293
3aa75e9
06706c4
9fef64b
37aaff4
f2758fc
fd3dd47
bfeb14b
b97b952
7a4c242
e4a2d44
2dd159d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,23 +1,39 @@ | ||||||||||||||||
import {createStackNavigator} from '@react-navigation/stack'; | ||||||||||||||||
import React from 'react'; | ||||||||||||||||
import {View} from 'react-native'; | ||||||||||||||||
import {withOnyx} from 'react-native-onyx'; | ||||||||||||||||
import NoDropZone from '@components/DragAndDrop/NoDropZone'; | ||||||||||||||||
import useOnboardingLayout from '@hooks/useOnboardingLayout'; | ||||||||||||||||
import useThemeStyles from '@hooks/useThemeStyles'; | ||||||||||||||||
import OnboardingModalNavigatorScreenOptions from '@libs/Navigation/AppNavigator/OnboardingModalNavigatorScreenOptions'; | ||||||||||||||||
import Navigation from '@libs/Navigation/Navigation'; | ||||||||||||||||
import type {OnboardingModalNavigatorParamList} from '@libs/Navigation/types'; | ||||||||||||||||
import OnboardingPersonalDetails from '@pages/OnboardingPersonalDetails'; | ||||||||||||||||
import OnboardingPurpose from '@pages/OnboardingPurpose'; | ||||||||||||||||
import OnboardingWork from '@pages/OnboardingWork'; | ||||||||||||||||
import * as Report from '@userActions/Report'; | ||||||||||||||||
import ONYXKEYS from '@src/ONYXKEYS'; | ||||||||||||||||
import SCREENS from '@src/SCREENS'; | ||||||||||||||||
import Overlay from './Overlay'; | ||||||||||||||||
|
||||||||||||||||
type OnboardingModalNavigatorProps = { | ||||||||||||||||
/** Current onboarding completion status */ | ||||||||||||||||
hasCompletedGuidedSetupFlow: boolean; | ||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
const Stack = createStackNavigator<OnboardingModalNavigatorParamList>(); | ||||||||||||||||
|
||||||||||||||||
function OnboardingModalNavigator() { | ||||||||||||||||
function OnboardingModalNavigator({hasCompletedGuidedSetupFlow}: OnboardingModalNavigatorProps) { | ||||||||||||||||
const styles = useThemeStyles(); | ||||||||||||||||
const {shouldUseNarrowLayout} = useOnboardingLayout(); | ||||||||||||||||
|
||||||||||||||||
if (hasCompletedGuidedSetupFlow) { | ||||||||||||||||
Navigation.goBack(); | ||||||||||||||||
Report.navigateToConciergeChat(); | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think just going back without redirecting to Concierge is better. Let me know if there are any edge cases in which redirecting to Concierge is useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suppose you are in a report and clicked What if there's only one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
navigatorNotReady.mp4I see the navigator is not ready when navigating to these routes. So, it goes back to onboarding again as seen in the video. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought, this component is defined in Route, so navigation should be ready already...Pushed fix as you mentioned |
||||||||||||||||
// eslint-disable-next-line react/jsx-no-useless-fragment | ||||||||||||||||
return <></>; | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me, when I test it on IOS and android, |
||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
return ( | ||||||||||||||||
<NoDropZone> | ||||||||||||||||
<Overlay /> | ||||||||||||||||
|
@@ -45,4 +61,9 @@ function OnboardingModalNavigator() { | |||||||||||||||
|
||||||||||||||||
OnboardingModalNavigator.displayName = 'OnboardingModalNavigator'; | ||||||||||||||||
|
||||||||||||||||
export default OnboardingModalNavigator; | ||||||||||||||||
export default withOnyx<OnboardingModalNavigatorProps, OnboardingModalNavigatorProps>({ | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||
hasCompletedGuidedSetupFlow: { | ||||||||||||||||
key: ONYXKEYS.NVP_ONBOARDING, | ||||||||||||||||
selector: (onboarding) => onboarding?.hasCompletedGuidedSetupFlow ?? true, | ||||||||||||||||
}, | ||||||||||||||||
})(OnboardingModalNavigator); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ import type MapboxAccessToken from './MapboxAccessToken'; | |
import type Modal from './Modal'; | ||
import type Network from './Network'; | ||
import type NewGroupChatDraft from './NewGroupChatDraft'; | ||
import type Onboarding from './Onboarding'; | ||
import type {OnyxUpdateEvent, OnyxUpdatesFromServer} from './OnyxUpdatesFromServer'; | ||
import type {DecisionName, OriginalMessageIOU} from './OriginalMessage'; | ||
import type PersonalBankAccount from './PersonalBankAccount'; | ||
|
@@ -108,6 +109,7 @@ export type { | |
MapboxAccessToken, | ||
Modal, | ||
Network, | ||
Onboarding, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this for? I don't see this export from this file being used anywhere. |
||
OnyxUpdateEvent, | ||
OnyxUpdatesFromServer, | ||
PersonalBankAccount, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change the type? for old accounts the nvp is an empty array so I think we need to keep this