From 7ed9d17ce745abc38a27d4994452a136357aba46 Mon Sep 17 00:00:00 2001 From: shpuld Date: Sun, 7 Jul 2019 23:02:09 +0300 Subject: [PATCH] Add thread muting to context menu of status --- src/components/extra_buttons/extra_buttons.js | 15 ++++++++++++--- src/components/extra_buttons/extra_buttons.vue | 16 +++++++++++++++- src/i18n/en.json | 4 +++- src/i18n/fi.json | 9 ++++++++- src/modules/statuses.js | 12 ++++++++++++ src/services/api/api.service.js | 14 ++++++++++++++ .../backend_interactor_service.js | 4 ++++ .../entity_normalizer.service.js | 1 + 8 files changed, 69 insertions(+), 6 deletions(-) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 528da301..56b2c41e 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -34,6 +34,18 @@ const ExtraButtons = { .then(() => this.$emit('onSuccess')) .catch(err => this.$emit('onError', err.error.error)) }, + muteConversation () { + this.refreshPopper() + this.$store.dispatch('muteConversation', this.status.id) + .then(() => this.$emit('onSuccess')) + .catch(err => this.$emit('onError', err.error.error)) + }, + unmuteConversation () { + this.refreshPopper() + this.$store.dispatch('unmuteConversation', this.status.id) + .then(() => this.$emit('onSuccess')) + .catch(err => this.$emit('onError', err.error.error)) + }, refreshPopper () { this.showPopper = false this.showDropDown = false @@ -54,9 +66,6 @@ const ExtraButtons = { }, canPin () { return this.ownStatus && (this.status.visibility === 'public' || this.status.visibility === 'unlisted') - }, - enabled () { - return this.canPin || this.canDelete } } } diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index 8e24e9a5..5027be1b 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -1,6 +1,6 @@