Merge branch 'fix/user-view-without-posts' into 'develop'

Use state object for user view instead of timeline.

See merge request pleroma/pleroma-fe!161
This commit is contained in:
Shpuld Shpludson 2017-11-14 16:34:32 +00:00
commit dff1153d1c
4 changed files with 21 additions and 2 deletions

View file

@ -5,6 +5,9 @@ const UserProfile = {
created () {
this.$store.commit('clearTimeline', { timeline: 'user' })
this.$store.dispatch('startFetching', ['user', this.userId])
if (!this.$store.state.users.usersObject[this.userId]) {
this.$store.dispatch('fetchUser', this.userId)
}
},
destroyed () {
this.$store.dispatch('stopFetching', 'user')
@ -18,7 +21,7 @@ const UserProfile = {
if (this.timeline.statuses[0]) {
return this.timeline.statuses[0].user
} else {
return false
return this.$store.state.users.usersObject[this.userId] || false
}
}
},