ataverascrespo / RecordRack

Digital music collections and social platform
https://recordrack.ca
GNU General Public License v3.0
1 stars 1 forks source link

User page doesn't reload on state changes #2

Closed ataverascrespo closed 11 months ago

ataverascrespo commented 11 months ago

When i follow another user, the global state change does not reflect until a refresh of the entire app.

To replicate, sign in and follow another user. Navigate to other pages and navigate back. The follow has not reflected. It will only reflect on refresh.

ataverascrespo commented 11 months ago

Found the issue.

https://github.com/ataverascrespo/RecordRack/blob/e5d6a89b58568ba13a6b3454c312379d832fb5cb/client-app/src/features/main/MainUserPage.tsx#L32C17-L40C18

SetViewedUser just sets the current signed in user as the viewed user, whereas GetViewedUser actually parses the URL username to fetch them from the API. That logic was made to save on some API calls, but now I see lowering round trips doesn't make sense if it affects the logic of the app. Getting rid of that first condition check (with setViewedUser) should hopefully solve the problem.