From ab99d5ef952998cfe277dfbb32dd9fe238c91f48 Mon Sep 17 00:00:00 2001 From: jasper Date: Tue, 26 Mar 2019 13:35:08 -0700 Subject: [PATCH 1/3] Fix warnings in user profile routing --- src/components/basic_user_card/basic_user_card.js | 1 + .../user_profile_link_generator.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/basic_user_card/basic_user_card.js b/src/components/basic_user_card/basic_user_card.js index 87085a28..a80e6cf0 100644 --- a/src/components/basic_user_card/basic_user_card.js +++ b/src/components/basic_user_card/basic_user_card.js @@ -20,6 +20,7 @@ const BasicUserCard = { this.userExpanded = !this.userExpanded }, userProfileLink (user) { + console.log('22222222222222222222222222222') return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) } } diff --git a/src/services/user_profile_link_generator/user_profile_link_generator.js b/src/services/user_profile_link_generator/user_profile_link_generator.js index a214ca48..5b430328 100644 --- a/src/services/user_profile_link_generator/user_profile_link_generator.js +++ b/src/services/user_profile_link_generator/user_profile_link_generator.js @@ -3,8 +3,8 @@ import { includes } from 'lodash' const generateProfileLink = (id, screenName, restrictedNicknames) => { const complicated = (isExternal(screenName) || includes(restrictedNicknames, screenName)) return { - name: (complicated ? 'external-user-profile' : 'user-profile'), - params: (complicated ? { id } : { name: screenName }) + name: (!screenName || complicated ? 'external-user-profile' : 'user-profile'), + params: (!screenName || complicated ? { id } : { name: screenName }) } } From 26955af60be26cf7ecba5d9b6ae03c11e111c1a4 Mon Sep 17 00:00:00 2001 From: jasper Date: Tue, 26 Mar 2019 13:36:33 -0700 Subject: [PATCH 2/3] Remove console log --- src/components/basic_user_card/basic_user_card.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/basic_user_card/basic_user_card.js b/src/components/basic_user_card/basic_user_card.js index a80e6cf0..87085a28 100644 --- a/src/components/basic_user_card/basic_user_card.js +++ b/src/components/basic_user_card/basic_user_card.js @@ -20,7 +20,6 @@ const BasicUserCard = { this.userExpanded = !this.userExpanded }, userProfileLink (user) { - console.log('22222222222222222222222222222') return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) } } From e6f9b1517b6a0b8e58c5d9c3552b70850f05c528 Mon Sep 17 00:00:00 2001 From: jasper Date: Thu, 28 Mar 2019 18:43:03 -0700 Subject: [PATCH 3/3] Fix: Change condition --- .../user_profile_link_generator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/user_profile_link_generator/user_profile_link_generator.js b/src/services/user_profile_link_generator/user_profile_link_generator.js index 5b430328..16f1531d 100644 --- a/src/services/user_profile_link_generator/user_profile_link_generator.js +++ b/src/services/user_profile_link_generator/user_profile_link_generator.js @@ -1,10 +1,10 @@ import { includes } from 'lodash' const generateProfileLink = (id, screenName, restrictedNicknames) => { - const complicated = (isExternal(screenName) || includes(restrictedNicknames, screenName)) + const complicated = !screenName || (isExternal(screenName) || includes(restrictedNicknames, screenName)) return { - name: (!screenName || complicated ? 'external-user-profile' : 'user-profile'), - params: (!screenName || complicated ? { id } : { name: screenName }) + name: (complicated ? 'external-user-profile' : 'user-profile'), + params: (complicated ? { id } : { name: screenName }) } }