aboutsummaryrefslogtreecommitdiff
path: root/src/components/domain_mute_card
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2020-06-27 07:19:49 +0000
committerShpuld Shpludson <shp@cock.li>2020-06-27 07:19:49 +0000
commitea0a12f6049241cb9e8fa7cd5bc6dc8b9852b57c (patch)
tree36863abf8ac320756bc16906b11a7892ea7da0dc /src/components/domain_mute_card
parentbad3dacfac1ef3dd2c0f55b53fb78f4bf410a01e (diff)
parentbbb91d8ae3f1c3d5374de7610e723e63121e8222 (diff)
Merge branch 'develop' into 'iss-149/profile-fields-setting'
# Conflicts: # src/components/settings_modal/tabs/profile_tab.vue
Diffstat (limited to 'src/components/domain_mute_card')
-rw-r--r--src/components/domain_mute_card/domain_mute_card.js11
-rw-r--r--src/components/domain_mute_card/domain_mute_card.vue15
2 files changed, 26 insertions, 0 deletions
diff --git a/src/components/domain_mute_card/domain_mute_card.js b/src/components/domain_mute_card/domain_mute_card.js
index c8e838ba..f234dcb0 100644
--- a/src/components/domain_mute_card/domain_mute_card.js
+++ b/src/components/domain_mute_card/domain_mute_card.js
@@ -5,9 +5,20 @@ const DomainMuteCard = {
components: {
ProgressButton
},
+ computed: {
+ user () {
+ return this.$store.state.users.currentUser
+ },
+ muted () {
+ return this.user.domainMutes.includes(this.domain)
+ }
+ },
methods: {
unmuteDomain () {
return this.$store.dispatch('unmuteDomain', this.domain)
+ },
+ muteDomain () {
+ return this.$store.dispatch('muteDomain', this.domain)
}
}
}
diff --git a/src/components/domain_mute_card/domain_mute_card.vue b/src/components/domain_mute_card/domain_mute_card.vue
index 567d81c5..97aee243 100644
--- a/src/components/domain_mute_card/domain_mute_card.vue
+++ b/src/components/domain_mute_card/domain_mute_card.vue
@@ -4,6 +4,7 @@
{{ domain }}
</div>
<ProgressButton
+ v-if="muted"
:click="unmuteDomain"
class="btn btn-default"
>
@@ -12,6 +13,16 @@
{{ $t('domain_mute_card.unmute_progress') }}
</template>
</ProgressButton>
+ <ProgressButton
+ v-else
+ :click="muteDomain"
+ class="btn btn-default"
+ >
+ {{ $t('domain_mute_card.mute') }}
+ <template slot="progress">
+ {{ $t('domain_mute_card.mute_progress') }}
+ </template>
+ </ProgressButton>
</div>
</template>
@@ -34,5 +45,9 @@
button {
width: 10em;
}
+
+ .autosuggest-results & {
+ padding-left: 1em;
+ }
}
</style>