From 7ed9d17ce745abc38a27d4994452a136357aba46 Mon Sep 17 00:00:00 2001 From: shpuld Date: Sun, 7 Jul 2019 23:02:09 +0300 Subject: Add thread muting to context menu of status --- src/components/extra_buttons/extra_buttons.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/components/extra_buttons/extra_buttons.js') 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 } } } -- cgit v1.2.3-70-g09d2 From f1bdbeabf0294bd7e2ef71f9d61118d3dca442e1 Mon Sep 17 00:00:00 2001 From: shpuld Date: Sat, 10 Aug 2019 15:53:46 +0300 Subject: fix js error on mute --- src/components/extra_buttons/extra_buttons.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/components/extra_buttons/extra_buttons.js') diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 8d123293..2d05ad39 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -18,13 +18,11 @@ const ExtraButtons = { .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)) -- cgit v1.2.3-70-g09d2 From 92a0c475f796989098bf84c813900c0fd89da7d0 Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 20 Aug 2019 16:55:42 -0400 Subject: hide mute conversation button to guests --- src/components/extra_buttons/extra_buttons.js | 3 +++ src/components/extra_buttons/extra_buttons.vue | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/components/extra_buttons/extra_buttons.js') diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 2d05ad39..5ac73e97 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -40,6 +40,9 @@ const ExtraButtons = { }, canPin () { return this.ownStatus && (this.status.visibility === 'public' || this.status.visibility === 'unlisted') + }, + canMute () { + return !!this.currentUser } } } diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index 564d34df..1b48540e 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -9,14 +9,14 @@