Proper Title Displayed Above Other User's Feeds

Words
184
Reading
1 min
Listen
Play
9y

Issue

When a Steemit user visited the feed of another user (https://steemit.com/@__user__/feed), the title of the page read "My Feed" even though it was the feed of another user. This Github issue describes the problem.
The problem
This is a screenshot of another user's feed. Notice that the title of the page is "My Feed". This image was taken from the issue on Github.

Solution

To fix this problem, I modified the PostsIndex page to use a variable containing the username of the feed we are viewing. If that username is the same as the username of the user logged in, it still says "My Feed". Otherwise, it changes the title of the page to "User's Feed".

Whereas the previous code merely checked to see if the user was viewing a feed and automatically labelled it 'My Feed', my code also checks if (account_name === this.props.username). If this is true, the user is viewing their own feed and it says 'My Feed'. In the else case, it sets the page title to account_name + "'s Feed".

Viewing your own feed

Viewing another user's feed



Posted on Utopian.io - Rewarding Open Source Contributors