Only reload user if it _is_ a user #232

Merged
floatingghost merged 5 commits from four-oh-four into develop 2022-11-22 14:40:25 +00:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit 6a29710e16 - Show all commits

View File

@ -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)
}
},