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 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/components/user_profile/user_profile.js') 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: { -- cgit v1.2.3-70-g09d2