-
Notifications
You must be signed in to change notification settings - Fork 4k
Prevent LHN from remounting after navigating away from Inbox #83887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c6f1325
e71bcad
f8a01ee
eb9c4e5
7664d46
a09a9fe
0815a80
5e809e4
4512c8a
a699d01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,7 @@ function usePreloadFullScreenNavigators() { | |
| } | ||
| hasPreloadedRef.current = true; | ||
| setTimeout(() => { | ||
| const currentRoutes = navigation.getState().routes; | ||
| for (const tabName of TABS_TO_PRELOAD) { | ||
| // Don't preload the current tab | ||
| const isCurrentTab = TAB_TO_FULLSCREEN[tabName].includes(route.name as FullScreenName); | ||
|
|
@@ -147,6 +148,13 @@ function usePreloadFullScreenNavigators() { | |
| continue; | ||
| } | ||
|
|
||
| // Don't preload tabs whose navigator is already in the regular routes stack | ||
| const isRouteInStack = currentRoutes.some((r) => TAB_TO_FULLSCREEN[tabName].includes(r.name as FullScreenName)); | ||
|
|
||
| if (isRouteInStack) { | ||
| continue; | ||
|
Comment on lines
+152
to
+155
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This new Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cold-mount behavior on Android is tied to |
||
| } | ||
|
|
||
| // Preload everything else | ||
| preloadTab(tabName, navigation, subscriptionPlan); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not related, but why is this timer not getting cleared on unmount?