Merged
Conversation
When navigating to profile sub-routes like /handle/albums or /handle/playlists, the page was incorrectly showing the first tab instead of the tab specified in the URL. This was caused by a race condition in useProfilePage where: 1. The profile handle change would reset activeTab to null 2. The default tab logic would then set it to the first tab 3. The URL tab effect would try to set the correct tab, but too late Fixed by: - Initializing activeTab state with the URL tab parameter if present - Preserving the URL tab when resetting state on profile handle changes - Adding params.tab to the dependency array of the reset effect Also added a test to verify the fix works correctly. Co-authored-by: Dylan Jeffers <dylanjeffers@users.noreply.github.com>
Contributor
|
Cursor Agent can help with this pull request. Just |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes profile tab routing to correctly display the specified tab for profile sub-routes like
/handle/albums.This PR resolves a race condition in the
useProfilePagehook where theactiveTabwas incorrectly reset tonulland then overridden by the default tab logic before the URL tab could be applied. The fix ensures the URL tab parameter is prioritized during initialization and preserved when the profile handle changes.Slack Thread