Only reload user if it _is_ a user #232
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue