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