make relationships separate from users

This commit is contained in:
Shpuld Shpuldson 2020-04-21 23:27:51 +03:00
parent d5457c323a
commit 6bb75a3a6d
25 changed files with 112 additions and 81 deletions

View file

@ -9,7 +9,7 @@ import { mapGetters } from 'vuex'
export default {
props: [
'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar'
'userId', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar'
],
data () {
return {
@ -21,6 +21,12 @@ export default {
this.$store.dispatch('fetchUserRelationship', this.user.id)
},
computed: {
user () {
return this.$store.getters.findUser(this.userId)
},
relationship () {
return this.$store.state.users.relationships[this.userId] || {}
},
classes () {
return [{
'user-card-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius