Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bump `react-navigation` (#4216)

* bump and rm patch

* fix types

* use `Home` default

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>

authored by

Hailey
Dan Abramov
and committed by
GitHub
8f8af476 888bec7b

+43 -103
+4 -4
package.json
··· 72 72 "@react-native-masked-view/masked-view": "0.3.0", 73 73 "@react-native-menu/menu": "^0.8.0", 74 74 "@react-native-picker/picker": "2.6.1", 75 - "@react-navigation/bottom-tabs": "^6.5.7", 76 - "@react-navigation/drawer": "^6.6.2", 77 - "@react-navigation/native": "^6.1.6", 78 - "@react-navigation/native-stack": "^6.9.12", 75 + "@react-navigation/bottom-tabs": "^6.5.20", 76 + "@react-navigation/drawer": "^6.6.15", 77 + "@react-navigation/native": "^6.1.17", 78 + "@react-navigation/native-stack": "^6.9.26", 79 79 "@segment/analytics-next": "^1.51.3", 80 80 "@segment/analytics-react": "^1.0.0-rc1", 81 81 "@segment/analytics-react-native": "^2.10.1",
-56
patches/@react-navigation+native+6.1.7.patch
··· 1 - diff --git a/node_modules/@react-navigation/native/lib/commonjs/useLinking.js b/node_modules/@react-navigation/native/lib/commonjs/useLinking.js 2 - index ef4f368..2b0da35 100644 3 - --- a/node_modules/@react-navigation/native/lib/commonjs/useLinking.js 4 - +++ b/node_modules/@react-navigation/native/lib/commonjs/useLinking.js 5 - @@ -273,8 +273,12 @@ function useLinking(ref, _ref) { 6 - }); 7 - const currentIndex = history.index; 8 - try { 9 - - if (nextIndex !== -1 && nextIndex < currentIndex) { 10 - - // An existing entry for this path exists and it's less than current index, go back to that 11 - + if ( 12 - + nextIndex !== -1 && 13 - + nextIndex < currentIndex && 14 - + // We should only go back if the entry exists and it's less than current index 15 - + history.get(nextIndex - currentIndex) 16 - + ) { // An existing entry for this path exists and it's less than current index, go back to that 17 - await history.go(nextIndex - currentIndex); 18 - } else { 19 - // We couldn't find an existing entry to go back to, so we'll go back by the delta 20 - diff --git a/node_modules/@react-navigation/native/lib/module/useLinking.js b/node_modules/@react-navigation/native/lib/module/useLinking.js 21 - index 62a3b43..11a5a28 100644 22 - --- a/node_modules/@react-navigation/native/lib/module/useLinking.js 23 - +++ b/node_modules/@react-navigation/native/lib/module/useLinking.js 24 - @@ -264,8 +264,12 @@ export default function useLinking(ref, _ref) { 25 - }); 26 - const currentIndex = history.index; 27 - try { 28 - - if (nextIndex !== -1 && nextIndex < currentIndex) { 29 - - // An existing entry for this path exists and it's less than current index, go back to that 30 - + if ( 31 - + nextIndex !== -1 && 32 - + nextIndex < currentIndex && 33 - + // We should only go back if the entry exists and it's less than current index 34 - + history.get(nextIndex - currentIndex) 35 - + ) { // An existing entry for this path exists and it's less than current index, go back to that 36 - await history.go(nextIndex - currentIndex); 37 - } else { 38 - // We couldn't find an existing entry to go back to, so we'll go back by the delta 39 - diff --git a/node_modules/@react-navigation/native/src/useLinking.tsx b/node_modules/@react-navigation/native/src/useLinking.tsx 40 - index 3db40b7..9ba4ecd 100644 41 - --- a/node_modules/@react-navigation/native/src/useLinking.tsx 42 - +++ b/node_modules/@react-navigation/native/src/useLinking.tsx 43 - @@ -381,7 +381,12 @@ export default function useLinking( 44 - const currentIndex = history.index; 45 - 46 - try { 47 - - if (nextIndex !== -1 && nextIndex < currentIndex) { 48 - + if ( 49 - + nextIndex !== -1 && 50 - + nextIndex < currentIndex && 51 - + // We should only go back if the entry exists and it's less than current index 52 - + history.get(nextIndex - currentIndex) 53 - + ) { 54 - // An existing entry for this path exists and it's less than current index, go back to that 55 - await history.go(nextIndex - currentIndex); 56 - } else {
-5
patches/@react-navigation+native+6.1.7.patch.md
··· 1 - # React Navigation history bug patch 2 - 3 - This patches react-navigation to fix the issues in https://github.com/bluesky-social/social-app/issues/710. 4 - 5 - This is based on the PR found at https://github.com/react-navigation/react-navigation/pull/11833
+7 -2
src/lib/routes/helpers.ts
··· 1 1 import {NavigationProp} from '@react-navigation/native' 2 - import {State, RouteParams} from './types' 2 + 3 + import {RouteParams, State} from './types' 3 4 4 5 export function getRootNavigation<T extends {}>( 5 6 nav: NavigationProp<T>, ··· 10 11 return nav 11 12 } 12 13 13 - export function getCurrentRoute(state: State) { 14 + export function getCurrentRoute(state?: State) { 15 + if (!state) { 16 + return {name: 'Home'} 17 + } 18 + 14 19 let node = state.routes[state.index || 0] 15 20 while (node.state?.routes && typeof node.state?.index === 'number') { 16 21 node = node.state?.routes[node.state?.index]
+3 -2
src/view/com/feeds/FeedPage.tsx
··· 3 3 import {AppBskyActorDefs} from '@atproto/api' 4 4 import {msg} from '@lingui/macro' 5 5 import {useLingui} from '@lingui/react' 6 - import {useNavigation} from '@react-navigation/native' 6 + import {NavigationProp, useNavigation} from '@react-navigation/native' 7 7 import {useQueryClient} from '@tanstack/react-query' 8 8 9 9 import {getRootNavigation, getTabState, TabState} from '#/lib/routes/helpers' ··· 19 19 import {useComposerControls} from '#/state/shell/composer' 20 20 import {useAnalytics} from 'lib/analytics/analytics' 21 21 import {ComposeIcon2} from 'lib/icons' 22 + import {AllNavigatorParams} from 'lib/routes/types' 22 23 import {s} from 'lib/styles' 23 24 import {useHeaderOffset} from '#/components/hooks/useHeaderOffset' 24 25 import {Feed} from '../posts/Feed' ··· 48 49 }) { 49 50 const {hasSession} = useSession() 50 51 const {_} = useLingui() 51 - const navigation = useNavigation() 52 + const navigation = useNavigation<NavigationProp<AllNavigatorParams>>() 52 53 const queryClient = useQueryClient() 53 54 const {openComposer} = useComposerControls() 54 55 const [isScrolledDown, setIsScrolledDown] = React.useState(false)
+29 -34
yarn.lock
··· 5669 5669 invariant "^2.2.4" 5670 5670 nullthrows "^1.1.1" 5671 5671 5672 - "@react-navigation/bottom-tabs@^6.5.7": 5673 - version "6.5.8" 5674 - resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.8.tgz#9536c6e45154abc183c363d07c94991e10b14856" 5675 - integrity sha512-0aa/jXea+LyBgR5NoRNWGKw0aFhjHwCkusigMRXIrCA4kINauDcAO0w0iFbZeKfaTCVAix5kK5UxDJJ2aJpevg== 5672 + "@react-navigation/bottom-tabs@^6.5.20": 5673 + version "6.5.20" 5674 + resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.20.tgz#5335e75b02c527ef0569bd97d4f9185d65616e49" 5675 + integrity sha512-ow6Z06iS4VqBO8d7FP+HsGjJLWt2xTWIvuWjpoCvsM/uQXzCRDIjBv9HaKcXbF0yTW7IMir0oDAbU5PFzEDdgA== 5676 5676 dependencies: 5677 - "@react-navigation/elements" "^1.3.18" 5677 + "@react-navigation/elements" "^1.3.30" 5678 5678 color "^4.2.3" 5679 5679 warn-once "^0.1.0" 5680 5680 5681 - "@react-navigation/core@^6.4.9": 5682 - version "6.4.9" 5683 - resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.9.tgz#aa09ce534f5393427cb993cf242abdbd848fb2c7" 5684 - integrity sha512-G9GH7bP9x0qqupxZnkSftnkn4JoXancElTvFc8FVGfEvxnxP+gBo3wqcknyBi7M5Vad4qecsYjCOa9wqsftv9g== 5681 + "@react-navigation/core@^6.4.16": 5682 + version "6.4.16" 5683 + resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.16.tgz#f9369a134805174536b9aa0f0f483b930511caf9" 5684 + integrity sha512-UDTJBsHxnzgFETR3ZxhctP+RWr4SkyeZpbhpkQoIGOuwSCkt1SE0qjU48/u6r6w6XlX8OqVudn1Ab0QFXTHxuQ== 5685 5685 dependencies: 5686 5686 "@react-navigation/routers" "^6.1.9" 5687 5687 escape-string-regexp "^4.0.0" 5688 5688 nanoid "^3.1.23" 5689 5689 query-string "^7.1.3" 5690 5690 react-is "^16.13.0" 5691 - use-latest-callback "^0.1.5" 5691 + use-latest-callback "^0.1.9" 5692 5692 5693 - "@react-navigation/drawer@^6.6.2": 5694 - version "6.6.3" 5695 - resolved "https://registry.yarnpkg.com/@react-navigation/drawer/-/drawer-6.6.3.tgz#ad48b3e0a2d2771e7fc8bc46a8b269ef2ae11e54" 5696 - integrity sha512-oQzHqH6svtSIun6+rikQtku6ye2CyyxT4xf3RQLVsBvK7+g4tDdKKLcjgoJmuT1zBZC3SSu3wNeqp8cg4cr2PQ== 5693 + "@react-navigation/drawer@^6.6.15": 5694 + version "6.6.15" 5695 + resolved "https://registry.yarnpkg.com/@react-navigation/drawer/-/drawer-6.6.15.tgz#fcedba68f735103dbc035911f5959ce926081d62" 5696 + integrity sha512-GLkFQNxjtmxB/qXSHmu1DfoB89jCzW64tmX68iPndth+9U+0IP27GcCCaMZxQfwj+nI8Kn2zlTlXAZDIIHE+DQ== 5697 5697 dependencies: 5698 - "@react-navigation/elements" "^1.3.18" 5698 + "@react-navigation/elements" "^1.3.30" 5699 5699 color "^4.2.3" 5700 5700 warn-once "^0.1.0" 5701 5701 5702 - "@react-navigation/elements@^1.3.18": 5703 - version "1.3.18" 5704 - resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.18.tgz#d8364b40276f3efb9c229c39da3b8b465f18f0a2" 5705 - integrity sha512-/0hwnJkrr415yP0Hf4PjUKgGyfshrvNUKFXN85Mrt1gY49hy9IwxZgrrxlh0THXkPeq8q4VWw44eHDfAcQf20Q== 5702 + "@react-navigation/elements@^1.3.30": 5703 + version "1.3.30" 5704 + resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.30.tgz#a81371f599af1070b12014f05d6c09b1a611fd9a" 5705 + integrity sha512-plhc8UvCZs0UkV+sI+3bisIyn78wz9O/BiWZXpounu72k/R/Sj5PuZYFJ1fi6psvriUveMCGh4LeZckAZu2qiQ== 5706 5706 5707 - "@react-navigation/native-stack@^6.9.12": 5708 - version "6.9.13" 5709 - resolved "https://registry.yarnpkg.com/@react-navigation/native-stack/-/native-stack-6.9.13.tgz#f308c398ee18fcd45de8ec7c04fe0641735feb31" 5710 - integrity sha512-ejlepMrvFneewL+XlXHHhn+6y3lwvavM4/R7XwBV0XJxCymujexK+7Vkg7UcvJ1lx4CRhOcyBSNfGmdNIHREyQ== 5707 + "@react-navigation/native-stack@^6.9.26": 5708 + version "6.9.26" 5709 + resolved "https://registry.yarnpkg.com/@react-navigation/native-stack/-/native-stack-6.9.26.tgz#90facf7783c9927f094bc9f01c613af75b6c241e" 5710 + integrity sha512-++dueQ+FDj2XkZ902DVrK79ub1vp19nSdAZWxKRgd6+Bc0Niiesua6rMCqymYOVaYh+dagwkA9r00bpt/U5WLw== 5711 5711 dependencies: 5712 - "@react-navigation/elements" "^1.3.18" 5712 + "@react-navigation/elements" "^1.3.30" 5713 5713 warn-once "^0.1.0" 5714 5714 5715 - "@react-navigation/native@^6.1.6": 5716 - version "6.1.7" 5717 - resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.7.tgz#968ef85b76d35f63111890668836fe2f125bbf90" 5718 - integrity sha512-W6E3+AtTombMucCRo6q7vPmluq8hSjS+IxfazJ/SokOe7ChJX7eLvvralIsJkjFj3iWV1KgOSnHxa6hdiFasBw== 5715 + "@react-navigation/native@^6.1.17": 5716 + version "6.1.17" 5717 + resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.17.tgz#439f15a99809d26ea4682d2a3766081cf2ca31cf" 5718 + integrity sha512-mer3OvfwWOHoUSMJyLa4vnBH3zpFmCwuzrBPlw7feXklurr/ZDiLjLxUScOot6jLRMz/67GyilEYMmP99LL0RQ== 5719 5719 dependencies: 5720 - "@react-navigation/core" "^6.4.9" 5720 + "@react-navigation/core" "^6.4.16" 5721 5721 escape-string-regexp "^4.0.0" 5722 5722 fast-deep-equal "^3.1.3" 5723 5723 nanoid "^3.1.23" ··· 21567 21567 version "1.1.2" 21568 21568 resolved "https://registry.yarnpkg.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz#497cefb13d863d687b08477d9e5a164ad8c1a6fb" 21569 21569 integrity sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA== 21570 - 21571 - use-latest-callback@^0.1.5: 21572 - version "0.1.6" 21573 - resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.6.tgz#3fa6e7babbb5f9bfa24b5094b22939e1e92ebcf6" 21574 - integrity sha512-VO/P91A/PmKH9bcN9a7O3duSuxe6M14ZoYXgA6a8dab8doWNdhiIHzEkX/jFeTTRBsX0Ubk6nG4q2NIjNsj+bg== 21575 21570 21576 21571 use-latest-callback@^0.1.9: 21577 21572 version "0.1.9"