aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_profile
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/user_profile')
-rw-r--r--src/components/user_profile/user_profile.js14
-rw-r--r--src/components/user_profile/user_profile.vue2
2 files changed, 11 insertions, 5 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: {
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 @@
<template>
- <div class="user-profile panel panel-default base00-background">
+ <div v-if="user" class="user-profile panel panel-default base00-background">
<user-card-content :user="user"></user-card-content>
</div>
</template>