aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_profile/user_profile.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/user_profile/user_profile.js')
-rw-r--r--src/components/user_profile/user_profile.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index 1d79713d..d7e19b36 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -15,18 +15,23 @@ const UserProfile = {
computed: {
timeline () { return this.$store.state.statuses.timelines.user },
userId () {
- return this.$route.params.id
+ return this.user.id
+ },
+ userName () {
+ return this.$route.params.name
},
user () {
if (this.timeline.statuses[0]) {
return this.timeline.statuses[0].user
} else {
- return this.$store.state.users.usersObject[this.userId] || false
+ return Object.values(this.$store.state.users.usersObject).filter(user => {
+ return user.name === this.userName
+ })[0] || false
}
}
},
watch: {
- userId () {
+ userName () {
this.$store.dispatch('stopFetching', 'user')
this.$store.commit('clearTimeline', { timeline: 'user' })
this.$store.dispatch('startFetching', ['user', this.userId])