Closed ataverascrespo closed 11 months ago
Been doing some digging. I wanted to check if this was a UI issue. I've reverted some of the most recent commits to the UI components that display the list of records but that hasn't affected anything, so it's clearly an issue from the stores.
It doesn't also seem to be coming from the stores. need to keep looking. Godspeed to myself :)
This one has got me stumped, and I'm making it a priority. On a feature branch I've rebased back to an old commit where I know this functionality was working .... and I'm still getting the exact same issue.
I think I got it working...?
For documentation purposes:
In ProfileStore ( the domain store which contains all Profile related logic ), I had set up the getViewedUser() function to reset the current user's record list information (such as their saved records, their search query, etc) because I figured, by the time this function gets called, we are switching users so this data is not important. I had the right idea, but this logic wasn't placed in a MobX action - meaning the UI wasn't actually observing or responding to those changes.
On the MainUserPage.tsx component, which wraps the component which displays all Records, I was utilizing part of the function in my useEffect() hook a little inefficiently. Everytime the useEffect() hook triggered, it would re-load the records for the current user, which is wasteful since those records are already stored in the RecordStore domain. So adding a quick truthy validation before the API function invokation seems to have fixed some wonky behaviour there.
Hopefully that's the end of it!
Previously, if a user navigated to a specific record page and navigated back to their rack list, the user would be returned to the scroll position of the album they navigated to. This allows users to quickly navigate back and forth through albums. As of now, this behaviour has seemingly disappeared.