diff --git a/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts b/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts index 44ef672f45a4..077dcdf56fe4 100644 --- a/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts +++ b/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts @@ -45,15 +45,6 @@ function adaptStateIfNecessary({state, options: {sidebarScreen, defaultCentralSc const paramsFromRoute = getParamsFromRoute(sidebarScreen); let params = pick(lastRoute?.params, paramsFromRoute); - // On a wide screen the backTo param has to be passed to the sidebar screen (SCREENS.WORKSPACE.INITIAL), because the back action is performed from this page - if (lastRoute?.name === SCREENS.WORKSPACE.PROFILE) { - const hasRouteBackToParam = lastRoute?.params && 'backTo' in lastRoute.params; - - if (hasRouteBackToParam) { - params = {...params, backTo: lastRoute.params.backTo}; - } - } - // @ts-expect-error Updating read only property // noinspection JSConstantReassignment state.stale = true; // eslint-disable-line diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 6662633e8336..8628007af5b1 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -1422,7 +1422,6 @@ type SettingsSplitNavigatorParamList = { type WorkspaceSplitNavigatorParamList = { [SCREENS.WORKSPACE.INITIAL]: { policyID: string; - backTo?: string; }; [SCREENS.WORKSPACE.PROFILE]: { policyID: string; diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index 7f99e7e9eca8..008077e013fa 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -406,14 +406,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac > { - if (route.params?.backTo) { - Navigation.goBack(ROUTES.HOME); - Navigation.isNavigationReady().then(() => Navigation.navigate(route.params?.backTo as Route)); - } else { - Navigation.goBack(ROUTES.SETTINGS_WORKSPACES); - } - }} + onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)} policyAvatar={policyAvatar} style={styles.headerBarDesktopHeight} />