Only reload user if it _is_ a user
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline failed

Ref #181
This commit is contained in:
FloatingGhost 2022-11-22 11:37:02 +00:00
parent b1f41add0e
commit 6a29710e16

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