From 82ff45a064295033eb803e6aac15d43c0fb6f885 Mon Sep 17 00:00:00 2001 From: Adam Grzybowski Date: Wed, 26 Mar 2025 15:23:05 +0100 Subject: [PATCH 1/2] fix getting history entry when navigating back in react-navigation --- ...eact-navigation+native+6.1.12+001+initial.patch} | 0 ...getting-history-entry-when-navigating-back.patch | 13 +++++++++++++ 2 files changed, 13 insertions(+) rename patches/{@react-navigation+native+6.1.12.patch => @react-navigation+native+6.1.12+001+initial.patch} (100%) create mode 100644 patches/@react-navigation+native+6.1.12+002+fix-getting-history-entry-when-navigating-back.patch diff --git a/patches/@react-navigation+native+6.1.12.patch b/patches/@react-navigation+native+6.1.12+001+initial.patch similarity index 100% rename from patches/@react-navigation+native+6.1.12.patch rename to patches/@react-navigation+native+6.1.12+001+initial.patch diff --git a/patches/@react-navigation+native+6.1.12+002+fix-getting-history-entry-when-navigating-back.patch b/patches/@react-navigation+native+6.1.12+002+fix-getting-history-entry-when-navigating-back.patch new file mode 100644 index 00000000000..b5d3e7ccadd --- /dev/null +++ b/patches/@react-navigation+native+6.1.12+002+fix-getting-history-entry-when-navigating-back.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@react-navigation/native/lib/module/useLinking.js b/node_modules/@react-navigation/native/lib/module/useLinking.js +index 95a0e32..adb25a0 100644 +--- a/node_modules/@react-navigation/native/lib/module/useLinking.js ++++ b/node_modules/@react-navigation/native/lib/module/useLinking.js +@@ -294,7 +294,7 @@ export default function useLinking(ref, _ref) { + try { + if (nextIndex !== -1 && nextIndex < currentIndex && + // We should only go back if the entry exists and it's less than current index +- history.get(nextIndex - currentIndex)) { ++ history.get(nextIndex)) { + // An existing entry for this path exists and it's less than current index, go back to that + await history.go(nextIndex - currentIndex); + history.replace({ From 8c87f499792a7e2983151702aaabcf62656f1e87 Mon Sep 17 00:00:00 2001 From: Adam Grzybowski Date: Wed, 26 Mar 2025 15:23:24 +0100 Subject: [PATCH 2/2] change navigate to goBack --- src/libs/PolicyUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index cabcac6effa..c3a323ff58a 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -527,7 +527,7 @@ function getPolicyEmployeeListByIdWithoutCurrentUser(policies: OnyxCollection