diff options
| author | Roger Braun <roger@rogerbraun.net> | 2017-06-12 16:00:46 +0200 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2017-06-12 16:00:46 +0200 |
| commit | 090148ef6051ec2399fe47281db9f73955297d97 (patch) | |
| tree | 66183a1df20d0608060e895e2ee743dee0a8d8fc /src/components/user_profile/user_profile.js | |
| parent | 85cf036acd4c6e23c0128f5e3bb8730f4dabb32a (diff) | |
Start fetching user timelines.
Diffstat (limited to 'src/components/user_profile/user_profile.js')
| -rw-r--r-- | src/components/user_profile/user_profile.js | 14 |
1 files changed, 10 insertions, 4 deletions
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: { |
