summaryrefslogtreecommitdiff
path: root/src/client/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-10-31 15:30:22 +0900
committerGitHub <noreply@github.com>2021-10-31 15:30:22 +0900
commitfc65190ef7b687650018cccfee2219bf00827f70 (patch)
treed2482c79dd095509b8b57dac28db460fb812196a /src/client/components
parentfix: Fix #7895 (#7937) (diff)
downloadsharkey-fc65190ef7b687650018cccfee2219bf00827f70.tar.gz
sharkey-fc65190ef7b687650018cccfee2219bf00827f70.tar.bz2
sharkey-fc65190ef7b687650018cccfee2219bf00827f70.zip
feat: thread mute (#7930)
* feat: thread mute * chore: fix comment * fix test * fix * refactor
Diffstat (limited to 'src/client/components')
-rw-r--r--src/client/components/note-detailed.vue15
-rw-r--r--src/client/components/note.vue15
2 files changed, 30 insertions, 0 deletions
diff --git a/src/client/components/note-detailed.vue b/src/client/components/note-detailed.vue
index 40b0a68c58..568a2360d1 100644
--- a/src/client/components/note-detailed.vue
+++ b/src/client/components/note-detailed.vue
@@ -601,6 +601,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) {
@@ -657,6 +663,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,
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,