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
Showing only changes of commit 6a29710e16 - Show all commits

View file

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