-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
Description
Is your bug related to a problem? Please describe.
The components CardWithPicture.jsx and CardWithoutPicture.jsx depend on profile.user from the root state to display the profile picture and display name of tutorial authors. This causes unintended side effects:
- Incorrect User Data – When tutorials from multiple users appear in the feed, their profile picture and name can be incorrectly replaced when
profile.userupdates. - Unnecessary Re-renders – Since the profile state is global, every update triggers a re-render of all tutorial cards, leading to performance issues.
Steps to Reproduce:
- Open the tutorial feed containing multiple users.
- Observe that some tutorial cards show the wrong profile picture or name.
Expected Behavior:
- Each tutorial card should display the correct author's name and profile picture, independent of global state updates.
- Fetching a profile should not alter existing tutorial cards in the feed.
Describe the solution you'd like
- Modify
getUserProfileData()to return the requested user object instead of updating global state. - Store profile details locally within each tutorial card instead of relying on
profile.user.
Additional context
This issue significantly affects UX, causing misleading author information in the tutorial feed.