Skip to content

Commit 19392f2

Browse files
luacmartinsOSBotify
authored andcommitted
Merge pull request #89214 from software-mansion-labs/kuba_nowakowski/bugfix/89209-goBackToHome
fix go back home (cherry picked from commit bf1b257) (cherry-picked to staging by arosiclair)
1 parent 99224e5 commit 19392f2

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
@@ -483,10 +483,9 @@ function goUp(backToRoute: Route, options?: GoBackOptions) {
483483
return;
484484
}
485485

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

0 commit comments

Comments
 (0)