aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_profile/user_profile.js
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2018-12-22 17:32:35 +0200
committershpuld <shp@cock.li>2018-12-22 17:32:35 +0200
commitf72b1d048e636c0637dfb1469c32875bcacce61f (patch)
tree8711385018c1f04b14289024424becd0574b8386 /src/components/user_profile/user_profile.js
parent4836c8ac74569668001f1adc39fe84377ddb7dba (diff)
parente59b67e119f1f598354fb0dca86774e1b0f6c4c4 (diff)
Merge branch 'develop' into feature/replace-panel-switcher
Diffstat (limited to 'src/components/user_profile/user_profile.js')
-rw-r--r--src/components/user_profile/user_profile.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index d8d0c532..77bb1835 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -18,18 +18,24 @@ const UserProfile = {
return this.$store.state.statuses.timelines.user
},
userId () {
- return this.$route.params.id
+ return this.$route.params.id || this.user.id
},
userName () {
return this.$route.params.name
},
+ friends () {
+ return this.user.friends
+ },
+ followers () {
+ return this.user.followers
+ },
user () {
if (this.timeline.statuses[0]) {
return this.timeline.statuses[0].user
} else {
return Object.values(this.$store.state.users.usersObject).filter(user => {
return (this.isExternal ? user.id === this.userId : user.screen_name === this.userName)
- })[0] || false
+ })[0] || {}
}
},
fetchBy () {
@@ -67,7 +73,7 @@ const UserProfile = {
this.$store.dispatch('startFetching', ['user', this.userId])
},
user () {
- if (!this.user.followers) {
+ if (this.user.id && !this.user.followers) {
this.fetchFollowers()
this.fetchFriends()
}