projectmate
projectmate copied to clipboard
[BUG] #464 All pages reload and scroll to top when returning to tab …
…(unexpected refresh on tab focus - issue fixed
#464
Fixes Issue
Fixed the page refresh and scroll to top issue
Changes proposed
When switching tabs, the User Details API was being triggered, even though the user was not logged in, causing the request to fail. Since the application uses Server-Side Rendering (SSR), this failure resulted in a page refresh.
Fix:
To resolve this, I implemented a validation check before making the API call. The check ensures that the API is only triggered if the user is logged in. If no user is found, the API call is skipped, preventing unnecessary requests and page refreshes.