forked from Mirrors/elk
feat: support muting conversations (#614)
This commit is contained in:
parent
b6f0bd356a
commit
f65f9c9a1c
11 changed files with 37 additions and 2 deletions
|
@ -16,6 +16,7 @@ const {
|
|||
toggleFavourite,
|
||||
togglePin,
|
||||
toggleReblog,
|
||||
toggleMute,
|
||||
} = $(useStatusActions(props))
|
||||
|
||||
const clipboard = useClipboard()
|
||||
|
@ -148,6 +149,15 @@ async function editStatus() {
|
|||
@click="copyLink(status)"
|
||||
/>
|
||||
|
||||
<CommonDropdownItem
|
||||
v-if="currentUser && (status.account.id === currentUser.account.id || status.mentions.some(m => m.id === currentUser!.account.id))"
|
||||
:text="status.muted ? $t('menu.unmute_conversation') : $t('menu.mute_conversation')"
|
||||
:icon="status.muted ? 'i-ri:eye-line' : 'i-ri:eye-off-line'"
|
||||
:command="command"
|
||||
:disabled="isLoading.muted"
|
||||
@click="toggleMute()"
|
||||
/>
|
||||
|
||||
<NuxtLink :to="status.url" external target="_blank">
|
||||
<CommonDropdownItem
|
||||
v-if="status.url"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Status } from 'masto'
|
||||
|
||||
type Action = 'reblogged' | 'favourited' | 'bookmarked' | 'pinned'
|
||||
type Action = 'reblogged' | 'favourited' | 'bookmarked' | 'pinned' | 'muted'
|
||||
type CountField = 'reblogsCount' | 'favouritesCount'
|
||||
|
||||
export interface StatusActionsProps {
|
||||
|
@ -24,6 +24,7 @@ export function useStatusActions(props: StatusActionsProps) {
|
|||
bookmarked: false,
|
||||
pinned: false,
|
||||
translation: false,
|
||||
muted: false,
|
||||
})
|
||||
|
||||
async function toggleStatusAction(action: Action, fetchNewStatus: () => Promise<Status>, countField?: CountField) {
|
||||
|
@ -70,9 +71,15 @@ export function useStatusActions(props: StatusActionsProps) {
|
|||
() => masto.statuses[status.pinned ? 'unpin' : 'pin'](status.id),
|
||||
)
|
||||
|
||||
const toggleMute = async () => toggleStatusAction(
|
||||
'muted',
|
||||
() => masto.statuses[status.muted ? 'unmute' : 'mute'](status.id),
|
||||
)
|
||||
|
||||
return {
|
||||
status: $$(status),
|
||||
isLoading: $$(isLoading),
|
||||
toggleMute,
|
||||
toggleReblog,
|
||||
toggleFavourite,
|
||||
toggleBookmark,
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
"edit": "تعديل",
|
||||
"mention_account": "أذكر {0}",
|
||||
"mute_account": "كتم {0}",
|
||||
"mute_conversation": "تجاهل هذا المنصب",
|
||||
"open_in_original_site": "فتح في الموقع الأصلي",
|
||||
"pin_on_profile": "تثبيت على حسابك الشخصي",
|
||||
"show_untranslated": "عرض بدون ترجمة",
|
||||
|
@ -110,6 +111,7 @@
|
|||
"unblock_account": "رفع الحظر عن {0}",
|
||||
"unblock_domain": "رفع الحظر عن النطاق {0}",
|
||||
"unmute_account": "إلغاء كتم الحساب {0}",
|
||||
"unmute_conversation": "إعادة الصوت",
|
||||
"unpin_on_profile": "إلغاء التثبيت من الملف الشخصي"
|
||||
},
|
||||
"nav": {
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
"edit": "Upravit",
|
||||
"mention_account": "Zmínit {0}",
|
||||
"mute_account": "Umlčet {0}",
|
||||
"mute_conversation": "Umlčet příspěvek",
|
||||
"open_in_original_site": "Otevřít na původní stránce",
|
||||
"pin_on_profile": "Připíchnout na profil",
|
||||
"show_untranslated": "Zobrazit nepřeložené",
|
||||
|
@ -106,6 +107,7 @@
|
|||
"unblock_account": "Odblokovat {0}",
|
||||
"unblock_domain": "Odblokovat doménu {0}",
|
||||
"unmute_account": "Odmlčet {0}",
|
||||
"unmute_conversation": "Přestat ignorovat příspěvek",
|
||||
"unpin_on_profile": "Odepnout z profilu"
|
||||
},
|
||||
"nav": {
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
"edit": "Bearbeiten",
|
||||
"mention_account": "Erwähne {0}",
|
||||
"mute_account": "{0} stummschalten",
|
||||
"mute_conversation": "Diesem Beitrag stummschalten",
|
||||
"open_in_original_site": "Auf Originalseite öffnen",
|
||||
"pin_on_profile": "An Profil anpinnen",
|
||||
"show_untranslated": "Übersetzung schliessen",
|
||||
|
@ -106,6 +107,7 @@
|
|||
"unblock_account": "Entsperre {0}",
|
||||
"unblock_domain": "Entsperren Domain {0}",
|
||||
"unmute_account": "Stummschaltung von {0} aufheben",
|
||||
"unmute_conversation": "Stummschaltung aufheben",
|
||||
"unpin_on_profile": "Von Profil lösen"
|
||||
},
|
||||
"nav": {
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
"edit": "Edit",
|
||||
"mention_account": "Mention {0}",
|
||||
"mute_account": "Mute {0}",
|
||||
"mute_conversation": "Mute this post",
|
||||
"open_in_original_site": "Open in original site",
|
||||
"pin_on_profile": "Pin on profile",
|
||||
"show_untranslated": "Show untranslated",
|
||||
|
@ -129,6 +130,7 @@
|
|||
"unblock_account": "Unblock {0}",
|
||||
"unblock_domain": "Unblock domain {0}",
|
||||
"unmute_account": "Unmute {0}",
|
||||
"unmute_conversation": "Unmute this post",
|
||||
"unpin_on_profile": "Unpin on profile"
|
||||
},
|
||||
"nav": {
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
"edit": "Edit",
|
||||
"mention_account": "Mention {0}",
|
||||
"mute_account": "Mute {0}",
|
||||
"mute_conversation": "Mute this post",
|
||||
"open_in_original_site": "Open in original site",
|
||||
"pin_on_profile": "Pin on profile",
|
||||
"show_untranslated": "Show untranslated",
|
||||
|
@ -129,6 +130,7 @@
|
|||
"unblock_account": "Unblock {0}",
|
||||
"unblock_domain": "Unblock domain {0}",
|
||||
"unmute_account": "Unmute {0}",
|
||||
"unmute_conversation": "Unmute this post",
|
||||
"unpin_on_profile": "Unpin on profile"
|
||||
},
|
||||
"nav": {
|
||||
|
|
|
@ -114,6 +114,7 @@
|
|||
"edit": "Editar",
|
||||
"mention_account": "Mencionar a {0}",
|
||||
"mute_account": "Silenciar a {0}",
|
||||
"mute_conversation": "Silenciar publicación",
|
||||
"open_in_original_site": "Abrir página original",
|
||||
"pin_on_profile": "Fijar en tu perfil",
|
||||
"show_untranslated": "Mostrar original",
|
||||
|
@ -125,6 +126,7 @@
|
|||
"unblock_account": "Desbloquear a {0}",
|
||||
"unblock_domain": "Desbloquear dominio {0}",
|
||||
"unmute_account": "Dejar de silenciar a {0}",
|
||||
"unmute_conversation": "Dejar de silenciar la publicación",
|
||||
"unpin_on_profile": "Desfijar del perfil"
|
||||
},
|
||||
"nav": {
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
"edit": "Éditer",
|
||||
"mention_account": "Mentionner {0}",
|
||||
"mute_account": "Mettre en sourdine {0}",
|
||||
"mute_conversation": "Message muet",
|
||||
"open_in_original_site": "Ouvrir sur le site d'origine",
|
||||
"pin_on_profile": "Épingler sur le profil",
|
||||
"show_untranslated": "Montrer le message non-traduit",
|
||||
|
@ -124,6 +125,7 @@
|
|||
"unblock_account": "Débloquer {0}",
|
||||
"unblock_domain": "Débloquer le domaine {0}",
|
||||
"unmute_account": "Enlever la sourdine à {0}",
|
||||
"unmute_conversation": "Réactiver le message",
|
||||
"unpin_on_profile": "Désépingler du profil"
|
||||
},
|
||||
"nav": {
|
||||
|
|
|
@ -37,10 +37,12 @@
|
|||
"direct_message_account": "{0}さんにダイレクトメッセージ",
|
||||
"mention_account": "{0}さんにメンション",
|
||||
"mute_account": "{0}さんをミュート",
|
||||
"mute_conversation": "ミュートポスト",
|
||||
"open_in_original_site": "元のサイトで開く",
|
||||
"unblock_account": "{0}さんのブロックを解除",
|
||||
"unblock_domain": "{0}のドメインブロックを解除",
|
||||
"unmute_account": "{0}さんのミュートを解除"
|
||||
"unmute_account": "{0}さんのミュートを解除",
|
||||
"unmute_conversation": "投稿のミュートを解除"
|
||||
},
|
||||
"nav": {
|
||||
"bookmarks": "ブックマーク",
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
"edit": "编辑",
|
||||
"mention_account": "提及 {0}",
|
||||
"mute_account": "屏蔽 {0}",
|
||||
"mute_conversation": "静音帖子",
|
||||
"open_in_original_site": "从源站打开",
|
||||
"pin_on_profile": "置顶在个人资料上",
|
||||
"show_untranslated": "显示原文",
|
||||
|
@ -120,6 +121,7 @@
|
|||
"unblock_account": "解除拉黑 {0}",
|
||||
"unblock_domain": "解除拉黑域名 {0}",
|
||||
"unmute_account": "解除屏蔽 {0}",
|
||||
"unmute_conversation": "取消静音帖子",
|
||||
"unpin_on_profile": "取消置顶"
|
||||
},
|
||||
"nav": {
|
||||
|
|
Loading…
Reference in a new issue