move domain block to drop down menu

This commit is contained in:
astra akari 2022-11-18 08:49:57 -05:00
parent 169282ea42
commit 862c93706c
4 changed files with 25 additions and 24 deletions

View file

@ -26,6 +26,9 @@ const AccountActions = {
ConfirmModal ConfirmModal
}, },
methods: { methods: {
refetchRelationship () {
return this.$store.dispatch('fetchUserRelationship', this.user.id)
},
showConfirmBlock () { showConfirmBlock () {
this.showingConfirmBlock = true this.showingConfirmBlock = true
}, },
@ -57,6 +60,14 @@ const AccountActions = {
}, },
reportUser () { reportUser () {
this.$store.dispatch('openUserReportingModal', { userId: this.user.id }) this.$store.dispatch('openUserReportingModal', { userId: this.user.id })
},
muteDomain () {
this.$store.dispatch('muteDomain', this.user.screen_name.split('@')[1])
.then(() => this.refetchRelationship())
},
unmuteDomain () {
this.$store.dispatch('unmuteDomain', this.user.screen_name.split('@')[1])
.then(() => this.refetchRelationship())
} }
}, },
computed: { computed: {

View file

@ -55,6 +55,20 @@
> >
{{ $t('user_card.report') }} {{ $t('user_card.report') }}
</button> </button>
<button
v-if="relationship.domain_blocking"
class="btn button-default btn-block dropdown-item"
@click="unmuteDomain"
>
{{ $t('user_card.domain_muted') }}
</button>
<button
v-else-if="!user.is_local"
class="btn button-default btn-block dropdown-item"
@click="muteDomain"
>
{{ $t('user_card.mute_domain') }}
</button>
</div> </div>
</template> </template>
<template v-slot:trigger> <template v-slot:trigger>

View file

@ -154,14 +154,6 @@ export default {
unmuteUser () { unmuteUser () {
this.$store.dispatch('unmuteUser', this.user.id) this.$store.dispatch('unmuteUser', this.user.id)
}, },
muteDomain () {
this.$store.dispatch('muteDomain', this.user.screen_name.split('@')[1])
.then(() => this.refetchRelationship())
},
unmuteDomain () {
this.$store.dispatch('unmuteDomain', this.user.screen_name.split('@')[1])
.then(() => this.refetchRelationship())
},
subscribeUser () { subscribeUser () {
return this.$store.dispatch('subscribeUser', this.user.id) return this.$store.dispatch('subscribeUser', this.user.id)
}, },

View file

@ -225,22 +225,6 @@
{{ $t('user_card.mute') }} {{ $t('user_card.mute') }}
</button> </button>
</div> </div>
<div>
<button
v-if="relationship.domain_blocking"
class="btn button-default btn-block toggled"
@click="unmuteDomain"
>
{{ $t('user_card.domain_muted') }}
</button>
<button
v-else
class="btn button-default btn-block"
@click="muteDomain"
>
{{ $t('user_card.mute_domain') }}
</button>
</div>
<div> <div>
<button <button
class="btn button-default btn-block" class="btn button-default btn-block"