Skip to content
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

Only run "disable min shell on foregrounding" behaviour if on the home screen #3825

Merged
merged 2 commits into from
May 2, 2024

Conversation

mozzius
Copy link
Member

@mozzius mozzius commented May 2, 2024

Currently, the "disable min shell on foregrounding" behaviour is in a useEffect in the home screen component. However, React Navigation does not unmount components even if you're on a different tab, so this means that this actually happens on every screen in the app, so long as you've loaded the home tab at some point (which you almost certainly have).

This wouldn't matter except that the new messages screen uses min shell mode, so if you unbackground it on the messages screen the tab bar overlaps the text input.

I've changed it to use useFocusEffect from React Navigation, which only runs the effect when the screen is active

Test plan

Check that the behaviour is unchanged on the home tab
Unbackground on the messages screen, and see that there's no tab bar

@mozzius mozzius requested a review from gaearon May 2, 2024 19:43
Copy link

render bot commented May 2, 2024

Copy link

github-actions bot commented May 2, 2024

Old size New size Diff
6.85 MB 6.85 MB 25 B (0.00%)

src/view/screens/Home.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg with rename

@mozzius mozzius merged commit 6da18e3 into main May 2, 2024
6 checks passed
@gaearon gaearon deleted the samuel/unbackground-experiment branch May 2, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants