nextjs-subscription-payments icon indicating copy to clipboard operation
nextjs-subscription-payments copied to clipboard

Prevent flash of footer on the account page

Open leerob opened this issue 4 years ago • 3 comments

When loading the account page, there's a small flash of the footer before the page renders

https://user-images.githubusercontent.com/9113740/105638688-a6d42580-5e39-11eb-9987-ed75bf62638e.mp4

leerob avatar Jan 24 '21 17:01 leerob

Hi! Could you include some steps for reproduction?

In Chrome 92 on macOS Big Sur, I tried

  • Sign in to the app
  • Subscribe to the Hobby Account with a Stripe test card
  • Navigate to Pricing
  • Navigate to Account

and could not replicate the flashing footer.

Will delete if this repo is not open to contributions - I'm new to the OS community

tedspare avatar Aug 27 '21 16:08 tedspare

Maybe this is because of the client side user check + redirect?

ingokpp avatar Aug 30 '21 16:08 ingokpp

Good eye! In account.js on line 30, unauthenticated users are redirected to /signin. Surely enough, the video shows that URL briefly:

Screen Shot 2021-09-07 at 12 26 48 PM

Maybe user is briefly null in the callback of onAuthStateChanged here?

Sent from Neat.run

tedspare avatar Sep 07 '21 16:09 tedspare

This has been fixed!

leerob avatar Jan 16 '23 16:01 leerob