2019-02-13 19:04:28 -08:00
|
|
|
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
|
|
|
|
|
|
|
const MuteCard = {
|
|
|
|
props: ['userId'],
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
progress: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
user () {
|
2019-03-08 12:40:57 -08:00
|
|
|
return this.$store.getters.findUser(this.userId)
|
2019-02-13 19:04:28 -08:00
|
|
|
},
|
2020-04-21 13:27:51 -07:00
|
|
|
relationship () {
|
2020-04-24 08:53:17 -07:00
|
|
|
return this.$store.getters.relationship(this.userId)
|
2020-04-21 13:27:51 -07:00
|
|
|
},
|
2019-02-13 19:04:28 -08:00
|
|
|
muted () {
|
2020-04-21 13:27:51 -07:00
|
|
|
return this.relationship.muting
|
2019-02-13 19:04:28 -08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
BasicUserCard
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
unmuteUser () {
|
|
|
|
this.progress = true
|
2020-04-21 13:27:51 -07:00
|
|
|
this.$store.dispatch('unmuteUser', this.userId).then(() => {
|
2019-02-13 19:04:28 -08:00
|
|
|
this.progress = false
|
|
|
|
})
|
|
|
|
},
|
|
|
|
muteUser () {
|
|
|
|
this.progress = true
|
2020-04-21 13:27:51 -07:00
|
|
|
this.$store.dispatch('muteUser', this.userId).then(() => {
|
2019-02-13 19:04:28 -08:00
|
|
|
this.progress = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MuteCard
|