From 862c93706cc51b3e53483dde21ead248058285e7 Mon Sep 17 00:00:00 2001 From: astra <nocebo@cathoderay.tube> Date: Fri, 18 Nov 2022 08:49:57 -0500 Subject: [PATCH] move domain block to drop down menu --- .../account_actions/account_actions.js | 11 +++++++++++ .../account_actions/account_actions.vue | 14 ++++++++++++++ src/components/user_card/user_card.js | 8 -------- src/components/user_card/user_card.vue | 16 ---------------- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 7a712e31..0f348474 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -26,6 +26,9 @@ const AccountActions = { ConfirmModal }, methods: { + refetchRelationship () { + return this.$store.dispatch('fetchUserRelationship', this.user.id) + }, showConfirmBlock () { this.showingConfirmBlock = true }, @@ -57,6 +60,14 @@ const AccountActions = { }, reportUser () { 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: { diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 2f86b102..126f6fa9 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -55,6 +55,20 @@ > {{ $t('user_card.report') }} </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> </template> <template v-slot:trigger> diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 3ca78467..f7bff63f 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -154,14 +154,6 @@ export default { unmuteUser () { 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 () { return this.$store.dispatch('subscribeUser', this.user.id) }, diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 1de9c0bb..c850e53b 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -225,22 +225,6 @@ {{ $t('user_card.mute') }} </button> </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> <button class="btn button-default btn-block"