diff options
| author | Shpuld Shpuldson <shpuld@gmail.com> | 2017-06-15 23:25:19 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shpuld@gmail.com> | 2017-06-15 23:25:19 +0300 |
| commit | e0e8965c08c09fee16d17e312c3788e13cdd1c88 (patch) | |
| tree | 53e6c4eebd4328f868c2d3f6eb0b26b3c3e1951d /src/components/user_profile | |
| parent | 44923afbee23ef7bd22c20d25bf7776b284f5f88 (diff) | |
| parent | 7d46e3965d06e039537066eeb5fac99ebcab978d (diff) | |
update branch and fix merge conflicts
Diffstat (limited to 'src/components/user_profile')
| -rw-r--r-- | src/components/user_profile/user_profile.js | 24 | ||||
| -rw-r--r-- | src/components/user_profile/user_profile.vue | 7 |
2 files changed, 24 insertions, 7 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 } } diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 11a61bfc..9241c469 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -1,6 +1,9 @@ <template> - <div class="user-profile panel panel-default base00-background"> - <user-card-content :user="user"></user-card-content> + <div> + <div v-if="user" class="user-profile panel panel-default base00-background"> + <user-card-content :user="user"></user-card-content> + </div> + <Timeline :title="'User Timeline'" v-bind:timeline="timeline" v-bind:timeline-name="'user'" :user-id="userId"/> </div> </template> |
