2019-02-13 22:04:28 -05:00
|
|
|
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
2025-07-09 17:45:13 +03:00
|
|
|
import UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue'
|
2019-02-13 22:04:28 -05:00
|
|
|
|
|
|
|
|
const MuteCard = {
|
|
|
|
|
props: ['userId'],
|
|
|
|
|
computed: {
|
|
|
|
|
user () {
|
2019-03-08 22:40:57 +02:00
|
|
|
return this.$store.getters.findUser(this.userId)
|
2019-02-13 22:04:28 -05:00
|
|
|
},
|
2020-04-21 23:27:51 +03:00
|
|
|
relationship () {
|
2020-04-24 18:53:17 +03:00
|
|
|
return this.$store.getters.relationship(this.userId)
|
2020-04-21 23:27:51 +03:00
|
|
|
},
|
2019-02-13 22:04:28 -05:00
|
|
|
muted () {
|
2020-04-21 23:27:51 +03:00
|
|
|
return this.relationship.muting
|
2025-07-09 17:45:13 +03:00
|
|
|
},
|
2025-07-17 14:53:56 +03:00
|
|
|
muteExpiryAvailable () {
|
|
|
|
|
return this.user.mute_expires_at !== undefined
|
|
|
|
|
},
|
2025-07-09 17:45:13 +03:00
|
|
|
muteExpiry () {
|
|
|
|
|
return this.user.mute_expires_at == null
|
|
|
|
|
? this.$t('user_card.mute_expires_forever')
|
|
|
|
|
: this.$t('user_card.mute_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()])
|
2019-02-13 22:04:28 -05:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
2025-07-09 17:45:13 +03:00
|
|
|
BasicUserCard,
|
|
|
|
|
UserTimedFilterModal
|
2019-02-13 22:04:28 -05:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
unmuteUser () {
|
|
|
|
|
this.progress = true
|
2025-07-09 17:56:52 +03:00
|
|
|
this.$store.dispatch('unmuteUser', this.userId)
|
2019-02-13 22:04:28 -05:00
|
|
|
},
|
|
|
|
|
muteUser () {
|
2025-07-09 17:45:13 +03:00
|
|
|
this.$refs.timedMuteDialog.optionallyPrompt()
|
2019-02-13 22:04:28 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default MuteCard
|