Proper way to hide splash screen until user is completely authenticated #2614
ChristopherGabba
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using AWS-amplify for the authentication within my app. I'm following all the guidance from amplify and have developed the following custom hook:
here is a simplified nav stack from AppNavigator.ts
I'm using ignite's introductory way to manage authentication using the
setProp("authToken", "ABCD123")method and it truly works fine with one exception -- every now and then the splash screen disappears before the authentication is done processing and the LoginSignUp screen shows for a second and then transitions into the app when the auth has finished processing.Surely the solution is not literally to just add a delay in
app.tsxto theuseInitialRootStorehook as suggested in the ignite boilerplate:While trickling up the delay time on the set timeout does work 90%, it doesn't fix the problem completely. There is still one time in ten where it takes the auth a little longer to process and you get the transition. I'm curious what infinitered suggests to do here...
Thanks,
Chris
Beta Was this translation helpful? Give feedback.
All reactions