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
|
|
|
},
|
|
|
|
muted () {
|
|
|
|
return this.user.muted
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
BasicUserCard
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
unmuteUser () {
|
|
|
|
this.progress = true
|
|
|
|
this.$store.dispatch('unmuteUser', this.user.id).then(() => {
|
|
|
|
this.progress = false
|
|
|
|
})
|
|
|
|
},
|
|
|
|
muteUser () {
|
|
|
|
this.progress = true
|
|
|
|
this.$store.dispatch('muteUser', this.user.id).then(() => {
|
|
|
|
this.progress = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MuteCard
|