magshimim-next / cv-next

A simple cv upload and peer review system
7 stars 2 forks source link

BUG: New user auth request sent every time navbar is opened #97

Closed YechiamW3 closed 2 months ago

YechiamW3 commented 2 months ago

In the navbar behavior we restart the "signed in" value each time (it's saved as a local state). We need to save the sign-in data as part of a more global state (swr cache/react context) and use it as the reference point for the sign in state. See network requests for example (should be noted: it seems swr does give back a cached data, I don't see a request on the SP logs): image

Relevant code: https://github.com/magshimim-next/cv-next/blob/3759cba9857a04fa9207d29e2fc420e5003aefe9/cv_next/components/layout/navbar/popupToggle.tsx#L16 https://github.com/magshimim-next/cv-next/blob/3759cba9857a04fa9207d29e2fc420e5003aefe9/cv_next/components/layout/navbar/popupToggle.tsx#L40

YechiamW3 commented 2 months ago

Note: it only happens on small-size screens (different nabvar behavior).