yandere_fe/src/components/mute_card/mute_card.js

41 lines
811 B
JavaScript
Raw Normal View History

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 () {
return this.$store.getters.findUser(this.userId)
2019-02-13 19:04:28 -08:00
},
2020-04-21 13:27:51 -07:00
relationship () {
return this.$store.state.users.relationships[this.userId]
},
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