-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51382 from bernhardoj/fix/50177-user-is-able-to-g…
…o-back-from-onboarding Fix able to dismiss onboarding flow with going back
- Loading branch information
Showing
6 changed files
with
39 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/libs/Navigation/linkingConfig/getOnboardingAdaptedState.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type {NavigationState, PartialState} from '@react-navigation/native'; | ||
import SCREENS from '@src/SCREENS'; | ||
|
||
export default function getOnboardingAdaptedState(state: PartialState<NavigationState>): PartialState<NavigationState> { | ||
const onboardingRoute = state.routes.at(0); | ||
if (!onboardingRoute || onboardingRoute.name === SCREENS.ONBOARDING.PURPOSE) { | ||
return state; | ||
} | ||
|
||
const routes = []; | ||
routes.push({name: SCREENS.ONBOARDING.PURPOSE}); | ||
if (onboardingRoute.name === SCREENS.ONBOARDING.ACCOUNTING) { | ||
routes.push({name: SCREENS.ONBOARDING.EMPLOYEES}); | ||
} | ||
routes.push(onboardingRoute); | ||
|
||
return { | ||
routes, | ||
index: routes.length - 1, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters