Skip to content

Commit 86797ee

Browse files
MikeValentine Zavgorodnev
authored andcommitted
Patch route user (#883)
* Tweak translate setting for followed/follower count * Remove un-needed setting, refactor match for existing regex setting covering needs
1 parent ac51da9 commit 86797ee

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

app/ResolveRoute.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export const routeRegex = {
22
PostsIndex: /^\/(@[\w\.\d-]+)\/feed\/?$/,
33
UserProfile1: /^\/(@[\w\.\d-]+)\/?$/,
44
UserProfile2: /^\/(@[\w\.\d-]+)\/(blog|posts|comments|recommended|transfers|curation-rewards|author-rewards|permissions|created|recent-replies|feed|password|followed|followers|settings)\/?$/,
5-
UserRoute: /^(@[\w\.\d//-]+)/,
65
UserEndPoints: /^(blog|posts|comments|recommended|transfers|curation-rewards|author-rewards|permissions|created|recent-replies|feed|password|followed|followers|settings)$/,
76
CategoryFilters: /^\/(hot|created|trending|active|promoted)\/?$/ig,
87
PostNoCategory: /^\/(@[\w\.\d-]+)\/([\w\d-]+)/,

app/components/pages/UserProfile.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,11 @@ export default class UserProfile extends React.Component {
396396
{about && <p className="UserProfile__bio">{about}</p>}
397397
<div className="UserProfile__stats">
398398
<span>
399-
<Link to={`/@${accountname}/followers`}>{followerCount ? translate('follower_count', {followerCount}) : translate('followers')}</Link>
399+
<Link to={`/@${accountname}/followers`}>{translate('follower_count', {followerCount})}</Link>
400400
{isMyAccount && <NotifiCounter fields="follow" />}
401401
</span>
402402
<span><Link to={`/@${accountname}`}>{translate('post_count', {postCount: account.post_count || 0})}</Link></span>
403-
<span><Link to={`/@${accountname}/followed`}>{followingCount ? translate('followed_count', {followingCount}) : translate('following')}</Link></span>
403+
<span><Link to={`/@${accountname}/followed`}>{translate('followed_count', {followingCount})}</Link></span>
404404
</div>
405405
<p className="UserProfile__info">
406406
{location && <span><Icon name="location" /> {location}</span>}

server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ app.use(function *(next) {
5959
}
6060
}
6161
// // handle non-existing users endpoints with 404
62-
if (this.method === 'GET' && routeRegex.UserRoute.test(this.url)) {
62+
if (this.method === 'GET' && routeRegex.PostNoCategory.test(this.url)) {
6363
const segments = this.url.split('/');
6464
if(segments[2] && !routeRegex.UserEndPoints.test(segments[2])) {
6565
this.status = 404;

0 commit comments

Comments
 (0)