summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-03-08 08:56:09 +0900
committerGitHub <noreply@github.com>2023-03-08 08:56:09 +0900
commit4c2f7c64cc2b70bd7b686e9ece1ebbc30eeab511 (patch)
tree0d1ce1e7b3cd567c98205343e1e550cc47c714fa /packages/frontend/src/scripts
parentrefactor(dev): separate test workflows (diff)
downloadsharkey-4c2f7c64cc2b70bd7b686e9ece1ebbc30eeab511.tar.gz
sharkey-4c2f7c64cc2b70bd7b686e9ece1ebbc30eeab511.tar.bz2
sharkey-4c2f7c64cc2b70bd7b686e9ece1ebbc30eeab511.zip
feat: Per-user renote mute (#10249)
* feat: per-user renote muting From FoundKey/c414f24a2c https://akkoma.dev/FoundKeyGang/FoundKey * Update ja-JP.yml * Delete renote-muting.ts * rename * fix ids * lint * fix * Update CHANGELOG.md * リノートをミュートしたユーザー一覧を見れるように * :art: * add test * fix test --------- Co-authored-by: Hélène <pleroma-dev@helene.moe>
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/get-user-menu.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts
index f5aa551bdb..d7eb331183 100644
--- a/packages/frontend/src/scripts/get-user-menu.ts
+++ b/packages/frontend/src/scripts/get-user-menu.ts
@@ -53,6 +53,14 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
}
}
+ async function toggleRenoteMute() {
+ os.apiWithDialog(user.isRenoteMuted ? 'renote-mute/delete' : 'renote-mute/create', {
+ userId: user.id,
+ }).then(() => {
+ user.isRenoteMuted = !user.isRenoteMuted;
+ });
+ }
+
async function toggleBlock() {
if (!await getConfirmed(user.isBlocking ? i18n.ts.unblockConfirm : i18n.ts.blockConfirm)) return;
@@ -180,6 +188,10 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
text: user.isMuted ? i18n.ts.unmute : i18n.ts.mute,
action: toggleMute,
}, {
+ icon: user.isRenoteMuted ? 'ti ti-repeat' : 'ti ti-repeat-off',
+ text: user.isRenoteMuted ? i18n.ts.renoteUnmute : i18n.ts.renoteMute,
+ action: toggleRenoteMute,
+ }, {
icon: 'ti ti-ban',
text: user.isBlocking ? i18n.ts.unblock : i18n.ts.block,
action: toggleBlock,