The implementation of the comment system I decided to go with is quite different to steemit.com and busy.org. The blockchain API has some limitations when it comes to retrieving replies to a post. There is currently no way to just fetch all the replies to a post unless you use the
get_state function which returns lots of unnecessary information like the current block, witness schedule and asset prices. In the future the aim is to take this function offchain with Hivemind but it's currently in alpha.
While experimenting I found that the
get_content_replies method only returns the direct children to a post. In order to fetch all the replies there would have to be a lot of recursive API calls so I decided to have a button that would load further replies like can be seen on YouTube.
This way the extra comments only need to be loaded if the user wants to see them.
However I then found that for some reason
get_content_replies doesn't return all the data for the post unlike
get_content, specifically the active votes. This is needed for the upvote system so the method that fetches the replies also fetches the votes for each reply.
When logged in a user can also reply to comments.
To improve the design (in my opinion) and prevent elements from moving around too much on the page I added loading states for most of the components. On the post page when the post and metadata is loading the general wireframe structure is displayed. This also informs the user that content is loading.
Currently, if a user wants to check a feed for new content they have to refresh the whole page. This feature adds a refresh button that checks if there are any new posts to show in that particular feed.
In the feed reducer I check if the reload property is present. If it is I reset the feed temporarily to a loading state again. This sets the post list to an empty array so that when new posts are fetched they are then displayed in the correct order.
- Add search to mobile view
- Follow users
- Re-brand with dmtv name, logo and colours