diff options
author | Hailey <me@haileyok.com> | 2024-02-21 17:54:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-21 17:54:25 -0800 |
commit | 93b5eff4d79a27557338e86c12f887316915a1fb (patch) | |
tree | 1be76945b020e290cb318c4339da9d6b335f8c94 /patches | |
parent | 874489b40227b2ce302e6be840e536e82847842f (diff) | |
download | voidsky-93b5eff4d79a27557338e86c12f887316915a1fb.tar.zst |
patch react-navigation to fix history bug (#2955)
* patch react-navigation - https://github.com/react-navigation/react-navigation/pull/11833 * add readme
Diffstat (limited to 'patches')
-rw-r--r-- | patches/@react-navigation+native+6.1.7.patch | 56 | ||||
-rw-r--r-- | patches/@react-navigation+native+6.1.7.patch.md | 5 |
2 files changed, 61 insertions, 0 deletions
diff --git a/patches/@react-navigation+native+6.1.7.patch b/patches/@react-navigation+native+6.1.7.patch new file mode 100644 index 000000000..b604e2c1a --- /dev/null +++ b/patches/@react-navigation+native+6.1.7.patch @@ -0,0 +1,56 @@ +diff --git a/node_modules/@react-navigation/native/lib/commonjs/useLinking.js b/node_modules/@react-navigation/native/lib/commonjs/useLinking.js +index ef4f368..2b0da35 100644 +--- a/node_modules/@react-navigation/native/lib/commonjs/useLinking.js ++++ b/node_modules/@react-navigation/native/lib/commonjs/useLinking.js +@@ -273,8 +273,12 @@ function useLinking(ref, _ref) { + }); + const currentIndex = history.index; + try { +- if (nextIndex !== -1 && nextIndex < currentIndex) { +- // An existing entry for this path exists and it's less than current index, go back to that ++ 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) ++ ) { // An existing entry for this path exists and it's less than current index, go back to that + await history.go(nextIndex - currentIndex); + } else { + // We couldn't find an existing entry to go back to, so we'll go back by the delta +diff --git a/node_modules/@react-navigation/native/lib/module/useLinking.js b/node_modules/@react-navigation/native/lib/module/useLinking.js +index 62a3b43..11a5a28 100644 +--- a/node_modules/@react-navigation/native/lib/module/useLinking.js ++++ b/node_modules/@react-navigation/native/lib/module/useLinking.js +@@ -264,8 +264,12 @@ export default function useLinking(ref, _ref) { + }); + const currentIndex = history.index; + try { +- if (nextIndex !== -1 && nextIndex < currentIndex) { +- // An existing entry for this path exists and it's less than current index, go back to that ++ 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) ++ ) { // An existing entry for this path exists and it's less than current index, go back to that + await history.go(nextIndex - currentIndex); + } else { + // We couldn't find an existing entry to go back to, so we'll go back by the delta +diff --git a/node_modules/@react-navigation/native/src/useLinking.tsx b/node_modules/@react-navigation/native/src/useLinking.tsx +index 3db40b7..9ba4ecd 100644 +--- a/node_modules/@react-navigation/native/src/useLinking.tsx ++++ b/node_modules/@react-navigation/native/src/useLinking.tsx +@@ -381,7 +381,12 @@ export default function useLinking( + const currentIndex = history.index; + + try { +- if (nextIndex !== -1 && nextIndex < currentIndex) { ++ 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) ++ ) { + // An existing entry for this path exists and it's less than current index, go back to that + await history.go(nextIndex - currentIndex); + } else { diff --git a/patches/@react-navigation+native+6.1.7.patch.md b/patches/@react-navigation+native+6.1.7.patch.md new file mode 100644 index 000000000..60b0d4e14 --- /dev/null +++ b/patches/@react-navigation+native+6.1.7.patch.md @@ -0,0 +1,5 @@ +# React Navigation history bug patch + +This patches react-navigation to fix the issues in https://github.com/bluesky-social/social-app/issues/710. + +This is based on the PR found at https://github.com/react-navigation/react-navigation/pull/11833 |