From fc65190ef7b687650018cccfee2219bf00827f70 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Sun, 31 Oct 2021 15:30:22 +0900
Subject: feat: thread mute (#7930)

* feat: thread mute

* chore: fix comment

* fix test

* fix

* refactor
---
 src/client/components/note.vue | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'src/client/components/note.vue')

diff --git a/src/client/components/note.vue b/src/client/components/note.vue
index 91a3e3b87d..681e819a22 100644
--- a/src/client/components/note.vue
+++ b/src/client/components/note.vue
@@ -576,6 +576,12 @@ export default defineComponent({
 			});
 		},
 
+		toggleThreadMute(mute: boolean) {
+			os.apiWithDialog(mute ? 'notes/thread-muting/create' : 'notes/thread-muting/delete', {
+				noteId: this.appearNote.id
+			});
+		},
+
 		getMenu() {
 			let menu;
 			if (this.$i) {
@@ -632,6 +638,15 @@ export default defineComponent({
 					text: this.$ts.watch,
 					action: () => this.toggleWatch(true)
 				}) : undefined,
+				statePromise.then(state => state.isMutedThread ? {
+					icon: 'fas fa-comment-slash',
+					text: this.$ts.unmuteThread,
+					action: () => this.toggleThreadMute(false)
+				} : {
+					icon: 'fas fa-comment-slash',
+					text: this.$ts.muteThread,
+					action: () => this.toggleThreadMute(true)
+				}),
 				this.appearNote.userId == this.$i.id ? (this.$i.pinnedNoteIds || []).includes(this.appearNote.id) ? {
 					icon: 'fas fa-thumbtack',
 					text: this.$ts.unpin,
-- 
cgit v1.2.3-freya

