diff options
| author | Shpuld Shpuldson <shpuld@gmail.com> | 2017-06-19 11:32:40 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shpuld@gmail.com> | 2017-06-19 11:32:40 +0300 |
| commit | 3785a863cb27af18fe91403189eff16f662dc2d0 (patch) | |
| tree | ff1ee977f74e9516fec4ca0691b017ce6f7867ff /src/components/user_profile/user_profile.js | |
| parent | 143aa3b990c0e0fac98c4a097d68e9f7518f1940 (diff) | |
| parent | 8e5d17a659b157f095ad3850ac3cdd2e537ac38b (diff) | |
Update branch and fix conflicts.
Diffstat (limited to 'src/components/user_profile/user_profile.js')
| -rw-r--r-- | src/components/user_profile/user_profile.js | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 4d52bc95..5f9d4d08 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -1,16 +1,30 @@ import UserCardContent from '../user_card_content/user_card_content.vue' -import { find } from 'lodash' +import Timeline from '../timeline/timeline.vue' const UserProfile = { + created () { + this.$store.commit('clearTimeline', { timeline: 'user' }) + this.$store.dispatch('startFetching', ['user', this.userId]) + }, + destroyed () { + this.$store.dispatch('stopFetching', 'user') + }, computed: { + timeline () { return this.$store.state.statuses.timelines.user }, + userId () { + return this.$route.params.id + }, user () { - const id = this.$route.params.id - const user = find(this.$store.state.users.users, {id}) - return user + if (this.timeline.statuses[0]) { + return this.timeline.statuses[0].user + } else { + return false + } } }, components: { - UserCardContent + UserCardContent, + Timeline } } |
