Skip to content

Commit bf1b257

Browse files
authored
Merge pull request Expensify#89214 from software-mansion-labs/kuba_nowakowski/bugfix/89209-goBackToHome
fix go back home
2 parents 63e39e6 + cbafd65 commit bf1b257

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/libs/Navigation/Navigation.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,9 @@ function goUp(backToRoute: Route, options?: GoBackOptions) {
484484
return;
485485
}
486486

487-
// For TAB_NAVIGATOR targets, use POP_TO so the underlying tab's nested state is restored from the
488-
// payload — plain pop can leave the active tab pointing at Home instead of the intended target.
489-
// Issue: https://github.com/Expensify/App/issues/89006
490-
if ((minimalAction.payload as {name?: string} | undefined)?.name === NAVIGATORS.TAB_NAVIGATOR) {
487+
// For TAB_NAVIGATOR targets, POP_TO restores nested state from the payload (#89006). Skip when
488+
// there's nothing to pop — POP_TO would otherwise pop to an older matching route (#89209).
489+
if (distanceToPop > 0 && (minimalAction.payload as {name?: string} | undefined)?.name === NAVIGATORS.TAB_NAVIGATOR) {
491490
navigationRef.current.dispatch({...minimalAction, type: CONST.NAVIGATION.ACTION_TYPE.POP_TO, target: targetState.key});
492491
return;
493492
}

0 commit comments

Comments
 (0)