From 6a29710e162ef76c92d680abd2f2492e744edc46 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Tue, 22 Nov 2022 11:37:02 +0000 Subject: [PATCH] Only reload user if it _is_ a user Ref #181 --- src/components/user_profile/user_profile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 8af757d7..42c5ec9e 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -33,6 +33,8 @@ const FriendList = withLoadMore({ additionalPropNames: ['userId'] })(List) +const isUserPage = ({ name }) => name === 'user-profile' || name === 'external-user-profile' + const UserProfile = { data () { return { @@ -182,12 +184,12 @@ const UserProfile = { }, watch: { '$route.params.id': function (newVal) { - if (newVal) { + if (isUserPage(this.$route) && newVal) { this.switchUser(newVal) } }, '$route.params.name': function (newVal) { - if (newVal) { + if (isUserPage(this.$route) && newVal) { this.switchUser(newVal) } },