Fix replies section showing the same replies multiple times
Words
122
Reading
1 min
Listen
Play
8y
Bug Fixes
What was the issue?
The replies section showed the same replies multiple times if you navigated to another page and back again on the main busy.org website.
What was the solution?
The solution was quite simple. When the component mounts it needs to check that there are currently no replies before fetching them. Now when the user first loads the page there are no replies so they are fetched. On subsequent loads e.g. after browsing to the home page and back, the same ones aren't fetched again. This doesn't hinder the get more replies function which still works if the user has lots of replies.
Posted on Utopian.io - Rewarding Open Source Contributors