-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Issue Description
When navigating to the /member/<member-id> route by clicking on a member's card on the / route, and then navigating back to the / route (without a hard refresh), the list of new users is rendered twice instead of once. This happens because the https://api.realdevsquad.com/users API is refetched each time the user navigates back to the / route, causing the same users to be appended to the list multiple times. The behavior is inconsistent, as the API is sometimes refetched and sometimes not.
Expected Behavior
When navigating back to the / route, the list of new users should be rendered only once. The user list should not be duplicated.
Current Behavior
Upon navigating back to the / route, the https://api.realdevsquad.com/users API is refetched, and the same users are appended to the list, causing the users to be rendered multiple times. This behavior is inconsistent, as the API is not always refetched.
Screenshots
Environment
- Operating System: Windows
- Browser (if applicable): Chrome
- Version of Software/Project: [e.g., v1.0.0]
Additional Information
- The re-fetching behavior is inconsistent and does not occur every time.
- In testing, the issue has been difficult to reproduce consistently.
- The issue only occurs when navigating to
/member/<member-id>by clicking on a member's card. Directly typing the URL does not trigger the problem.
Checklist
- I have read and followed the project's code of conduct.
- I have searched for similar issues before creating this one.
- I have provided all the necessary information to understand and reproduce the issue.
- I am willing to contribute to the resolution of this issue.
Steps to Reproduce
- Go to the members site]
- Click on a member's card to be redirected to
members.realdevsquad.com/<member-id>. - Navigate back to the
/route without a hard refresh. - Observe that the new users are rendered twice.
Possible Solutions
Ensure that the state is properly managed so that the user list is not duplicated. Making sure that we are not appending to the user's list and instead re-setting the state should fix the issue.
