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']
|
additionalPropNames: ['userId']
|
||||||
})(List)
|
})(List)
|
||||||
|
|
||||||
|
const isUserPage = ({ name }) => name === 'user-profile' || name === 'external-user-profile'
|
||||||
|
|
||||||
const UserProfile = {
|
const UserProfile = {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
@ -182,12 +184,12 @@ const UserProfile = {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.params.id': function (newVal) {
|
'$route.params.id': function (newVal) {
|
||||||
if (newVal) {
|
if (isUserPage(this.$route) && newVal) {
|
||||||
this.switchUser(newVal)
|
this.switchUser(newVal)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'$route.params.name': function (newVal) {
|
'$route.params.name': function (newVal) {
|
||||||
if (newVal) {
|
if (isUserPage(this.$route) && newVal) {
|
||||||
this.switchUser(newVal)
|
this.switchUser(newVal)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue