forked from AkkomaGang/akkoma-fe
Add domain block components
This commit is contained in:
parent
3dca3639fd
commit
cda1819d81
3 changed files with 29 additions and 0 deletions
|
@ -121,12 +121,23 @@ export default {
|
||||||
FollowButton
|
FollowButton
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
refetchRelationship () {
|
||||||
|
return this.$store.dispatch('fetchUserRelationship', this.user.id)
|
||||||
|
},
|
||||||
muteUser () {
|
muteUser () {
|
||||||
this.$store.dispatch('muteUser', this.user.id)
|
this.$store.dispatch('muteUser', this.user.id)
|
||||||
},
|
},
|
||||||
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)
|
||||||
},
|
},
|
||||||
|
|
|
@ -205,6 +205,22 @@
|
||||||
{{ $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"
|
||||||
|
|
|
@ -745,6 +745,8 @@
|
||||||
"mute_progress": "Muting…",
|
"mute_progress": "Muting…",
|
||||||
"hide_repeats": "Hide repeats",
|
"hide_repeats": "Hide repeats",
|
||||||
"show_repeats": "Show repeats",
|
"show_repeats": "Show repeats",
|
||||||
|
"domain_muted": "Unblock domain",
|
||||||
|
"mute_domain": "Block domain",
|
||||||
"bot": "Bot",
|
"bot": "Bot",
|
||||||
"admin_menu": {
|
"admin_menu": {
|
||||||
"moderation": "Moderation",
|
"moderation": "Moderation",
|
||||||
|
|
Loading…
Reference in a new issue