Skip to content

Commit

Permalink
Refactor check isReportInRhpOpened
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed Jun 20, 2024
1 parent 8b51309 commit 296e8dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libs/Navigation/linkTo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
}
}

if (action !== undefined) {
// When we navigate from the ReportScreen opened in RHP, this page shouldn't be removed from the navigation state to allow users to go back to it.
if (isReportInRhpOpened) {
action.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;
}
// When we navigate from the ReportScreen opened in RHP, this page shouldn't be removed from the navigation state to allow users to go back to it.
if (isReportInRhpOpened && action) {
action.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;
}

if (action !== undefined) {
root.dispatch(action);
} else {
root.reset(stateFromPath);
Expand Down

0 comments on commit 296e8dd

Please sign in to comment.