Fix having to click logout twice #31
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 rootindex.ts
gets rendered and redirects the app to the login layout.Changes
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 anymorehome
route and just put everything in the root app directory(auth)
don't conflict with(tabs)
so I felt like this was cleanerindex.ts
under(tabs)
on start upUnrelated changes
auth.ts
to usereact-native-firebase
's modular SDK since it was giving warningsreact-native-firebase
is structure internally so there's nothing we can do. I just addedauth.ts
to.eslintignore
so it doesn't hang and actually lets me commit.Testing