pleroma-fe/src/components/mute_card/mute_card.js

41 lines
806 B
JavaScript
Raw Normal View History

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 () {
return this.$store.getters.findUser(this.userId)
2019-02-14 14:04:28 +11:00
},
2020-04-22 06:27:51 +10:00
relationship () {
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