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

@ -2,11 +2,6 @@ import BasicUserCard from '../basic_user_card/basic_user_card.vue'
const BlockCard = {
props: ['userId'],
data () {
return {
progress: false
}
},
computed: {
user () {
return this.$store.getters.findUser(this.userId)
@ -16,6 +11,12 @@ const BlockCard = {
},
blocked () {
return this.relationship.blocking
},
blockExpiry () {
console.log(this.user)
return this.user.block_expires_at == null
? this.$t('user_card.block_expires_forever')
: this.$t('user_card.block_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()])
}
},
components: {
@ -29,10 +30,7 @@ const BlockCard = {
})
},
blockUser () {
this.progress = true
this.$store.dispatch('blockUser', this.user.id).then(() => {
this.progress = false
})
this.$refs.timedBlockDialog.optionallyPrompt()
}
}
}