block/mute cards update to show expiry and ask for it

This commit is contained in:
Henry Jameson 2025-07-09 17:45:13 +03:00
commit 8436f39eff
6 changed files with 48 additions and 47 deletions

View file

@ -1,12 +1,8 @@
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
import UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue'
const MuteCard = {
props: ['userId'],
data () {
return {
progress: false
}
},
computed: {
user () {
return this.$store.getters.findUser(this.userId)
@ -16,10 +12,16 @@ const MuteCard = {
},
muted () {
return this.relationship.muting
},
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()])
}
},
components: {
BasicUserCard
BasicUserCard,
UserTimedFilterModal
},
methods: {
unmuteUser () {
@ -29,10 +31,7 @@ const MuteCard = {
})
},
muteUser () {
this.progress = true
this.$store.dispatch('muteUser', this.userId).then(() => {
this.progress = false
})
this.$refs.timedMuteDialog.optionallyPrompt()
}
}
}