Only reload user if it _is_ a user (#232)

Ref #181

Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/232
This commit is contained in:
floatingghost 2022-11-22 14:40:25 +00:00
parent b1f41add0e
commit 105b934f90
6 changed files with 313 additions and 636 deletions

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