From 090148ef6051ec2399fe47281db9f73955297d97 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Mon, 12 Jun 2017 16:00:46 +0200 Subject: Start fetching user timelines. --- src/components/user_profile/user_profile.js | 14 ++++++++++---- src/components/user_profile/user_profile.vue | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/components/user_profile') diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 4d52bc95..4f35cf27 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -1,12 +1,18 @@ import UserCardContent from '../user_card_content/user_card_content.vue' -import { find } from 'lodash' const UserProfile = { + created () { + this.$store.dispatch('startFetching', ['user', this.userId]) + }, + destroyed () { + this.$store.dispatch('stopFetching', ['user', this.userId]) + }, computed: { + userId () { + return this.$route.params.id + }, user () { - const id = this.$route.params.id - const user = find(this.$store.state.users.users, {id}) - return user + return this.$store.state.users.usersObject[this.userId] } }, components: { diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 11a61bfc..fe693c9d 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -1,5 +1,5 @@ -- cgit v1.2.3-70-g09d2