Skip to content

Conversation

yxli001
Copy link
Contributor

@yxli001 yxli001 commented Apr 7, 2025

NOTE

The original issue was happening because the tabs layout isn't redirecting away when the state of firebaseUser changes. I think the second click to logout throws an error since the user is already logged out and forces the app to refresh, then the root index.ts gets rendered and redirects the app to the login layout.

Changes

  • Made tabs layout redirect to login when the user is not logged in
  • Removed index.ts from root layout since it was doing the redirecting before, but things don't redirect correctly when it's in the tabs layout since the index page isn't being rendered anymore
  • Removed the home route and just put everything in the root app directory
    • the routes under (auth) don't conflict with (tabs) so I felt like this was cleaner
    • The app renders index.ts under (tabs) on start up

Unrelated changes

  • Updated auth.ts to use react-native-firebase's modular SDK since it was giving warnings
    • This somehow caused eslint to hang on this file. ChatGPT said it was because of how react-native-firebase is structure internally so there's nothing we can do. I just added auth.ts to .eslintignore so it doesn't hang and actually lets me commit.

Testing

  • Manual testing

@yxli001 yxli001 requested a review from HarshGurnani as a code owner April 7, 2025 18:00
@yxli001 yxli001 changed the title fix ios build issue Fix having to click logout twice Apr 8, 2025
@HarshGurnani HarshGurnani merged commit b6496a6 into main Apr 8, 2025
2 checks passed
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