1- import type { RouteProp } from '@react-navigation/native' ;
21import React from 'react' ;
32import ImportSpreadsheet from '@components/ImportSpreadsheet' ;
43import useDynamicBackPath from '@hooks/useDynamicBackPath' ;
54import usePolicy from '@hooks/usePolicy' ;
65import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute' ;
6+ import type { PlatformStackScreenProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
77import type { SettingsNavigatorParamList } from '@libs/Navigation/types' ;
88import { goBackFromInvalidPolicy , hasAccountingConnections as hasAccountingConnectionsUtil } from '@libs/PolicyUtils' ;
99import NotFoundPage from '@pages/ErrorPage/NotFoundPage' ;
@@ -13,9 +13,9 @@ import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES';
1313import SCREENS from '@src/SCREENS' ;
1414import { isEmptyObject } from '@src/types/utils/EmptyObject' ;
1515
16- type ImportCategoriesPageProps = {
17- route : RouteProp < SettingsNavigatorParamList , typeof SCREENS . WORKSPACE . DYNAMIC_CATEGORIES_IMPORT | typeof SCREENS . SETTINGS_CATEGORIES . SETTINGS_CATEGORIES_IMPORT > ;
18- } ;
16+ type ImportCategoriesPageProps =
17+ | PlatformStackScreenProps < SettingsNavigatorParamList , typeof SCREENS . WORKSPACE . DYNAMIC_CATEGORIES_IMPORT >
18+ | PlatformStackScreenProps < SettingsNavigatorParamList , typeof SCREENS . SETTINGS_CATEGORIES . SETTINGS_CATEGORIES_IMPORT > ;
1919
2020function ImportCategoriesPage ( { route} : ImportCategoriesPageProps ) {
2121 const policyID = route . params . policyID ;
@@ -41,6 +41,7 @@ function ImportCategoriesPage({route}: ImportCategoriesPageProps) {
4141 < ImportSpreadsheet
4242 backTo = { isQuickSettingsFlow ? backTo : workspaceCategoriesListBackPath }
4343 goTo = { isQuickSettingsFlow ? ROUTES . SETTINGS_CATEGORIES_IMPORTED . getRoute ( policyID , backTo ) : workspaceGoToImportedPath }
44+ shouldForceReplaceNavigation = { ! isQuickSettingsFlow }
4445 />
4546 </ AccessOrNotFoundWrapper >
4647 ) ;
0 commit comments