@@ -12,6 +12,7 @@ import useOnyx from '@hooks/useOnyx';
1212import usePolicy from '@hooks/usePolicy' ;
1313import { importPolicyCategories } from '@libs/actions/Policy/Category' ;
1414import { findDuplicate , generateColumnNames } from '@libs/importSpreadsheetUtils' ;
15+ import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute' ;
1516import Navigation from '@libs/Navigation/Navigation' ;
1617import type { SettingsNavigatorParamList } from '@libs/Navigation/types' ;
1718import { hasAccountingConnections as hasAccountingConnectionsPolicyUtils , isControlPolicy } from '@libs/PolicyUtils' ;
@@ -43,6 +44,7 @@ function ImportedCategoriesPage({route}: ImportedCategoriesPageProps) {
4344 const backTo = isQuickSettingsFlow && 'backTo' in route . params ? route . params . backTo : undefined ;
4445
4546 const backPath = useDynamicBackPath ( DYNAMIC_ROUTES . WORKSPACE_CATEGORIES_IMPORTED . path ) ;
47+ const workspaceImportPath = createDynamicRoute ( DYNAMIC_ROUTES . WORKSPACE_CATEGORIES_IMPORT . path , ROUTES . WORKSPACE_CATEGORIES . getRoute ( policyID ) ) ;
4648
4749 const getColumnRoles = ( ) : ColumnRole [ ] => {
4850 const roles = [ ] ;
@@ -145,7 +147,7 @@ function ImportedCategoriesPage({route}: ImportedCategoriesPageProps) {
145147 >
146148 < HeaderWithBackButton
147149 title = { translate ( 'workspace.categories.importCategories' ) }
148- onBackButtonPress = { ( ) => Navigation . goBack ( isQuickSettingsFlow ? ROUTES . SETTINGS_CATEGORIES_IMPORT . getRoute ( policyID , backTo ) : backPath ) }
150+ onBackButtonPress = { ( ) => Navigation . goBack ( isQuickSettingsFlow ? ROUTES . SETTINGS_CATEGORIES_IMPORT . getRoute ( policyID , backTo ) : workspaceImportPath ) }
149151 />
150152 < ImportSpreadsheetColumns
151153 spreadsheetColumns = { spreadsheetColumns }
0 commit comments