From 86797ee37d7c980096ac4b67fcd8e8015fbceddc Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 21 Dec 2016 11:31:56 -0500 Subject: [PATCH] Patch route user (#883) * Tweak translate setting for followed/follower count * Remove un-needed setting, refactor match for existing regex setting covering needs --- app/ResolveRoute.js | 1 - app/components/pages/UserProfile.jsx | 4 ++-- server/server.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/ResolveRoute.js b/app/ResolveRoute.js index 1a6ba8e173..cce2d3025b 100644 --- a/app/ResolveRoute.js +++ b/app/ResolveRoute.js @@ -2,7 +2,6 @@ export const routeRegex = { PostsIndex: /^\/(@[\w\.\d-]+)\/feed\/?$/, UserProfile1: /^\/(@[\w\.\d-]+)\/?$/, UserProfile2: /^\/(@[\w\.\d-]+)\/(blog|posts|comments|recommended|transfers|curation-rewards|author-rewards|permissions|created|recent-replies|feed|password|followed|followers|settings)\/?$/, - UserRoute: /^(@[\w\.\d//-]+)/, UserEndPoints: /^(blog|posts|comments|recommended|transfers|curation-rewards|author-rewards|permissions|created|recent-replies|feed|password|followed|followers|settings)$/, CategoryFilters: /^\/(hot|created|trending|active|promoted)\/?$/ig, PostNoCategory: /^\/(@[\w\.\d-]+)\/([\w\d-]+)/, diff --git a/app/components/pages/UserProfile.jsx b/app/components/pages/UserProfile.jsx index 37292e8ea9..cb8c0737a5 100644 --- a/app/components/pages/UserProfile.jsx +++ b/app/components/pages/UserProfile.jsx @@ -396,11 +396,11 @@ export default class UserProfile extends React.Component { {about &&

{about}

}
- {followerCount ? translate('follower_count', {followerCount}) : translate('followers')} + {translate('follower_count', {followerCount})} {isMyAccount && } {translate('post_count', {postCount: account.post_count || 0})} - {followingCount ? translate('followed_count', {followingCount}) : translate('following')} + {translate('followed_count', {followingCount})}

{location && {location}} diff --git a/server/server.js b/server/server.js index 12b9f2ab3f..80940c41f9 100644 --- a/server/server.js +++ b/server/server.js @@ -59,7 +59,7 @@ app.use(function *(next) { } } // // handle non-existing users endpoints with 404 - if (this.method === 'GET' && routeRegex.UserRoute.test(this.url)) { + if (this.method === 'GET' && routeRegex.PostNoCategory.test(this.url)) { const segments = this.url.split('/'); if(segments[2] && !routeRegex.UserEndPoints.test(segments[2])) { this.status = 404;