diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-03 20:26:11 +0900 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-13 17:58:11 +0200 |
| commit | f6ba5cfaf4b147d7b9dc6349fea250f1fdf1088d (patch) | |
| tree | d3c10281ce2bfee3f79162f658565c28c64c1bbf /packages/frontend/src/scripts/get-user-menu.ts | |
| parent | upd: delete reactions properly in the DB (diff) | |
| download | sharkey-f6ba5cfaf4b147d7b9dc6349fea250f1fdf1088d.tar.gz sharkey-f6ba5cfaf4b147d7b9dc6349fea250f1fdf1088d.tar.bz2 sharkey-f6ba5cfaf4b147d7b9dc6349fea250f1fdf1088d.zip | |
merge: timeline 1
Diffstat (limited to 'packages/frontend/src/scripts/get-user-menu.ts')
| -rw-r--r-- | packages/frontend/src/scripts/get-user-menu.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index 24ca93495a..ab3f11d4db 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -80,6 +80,15 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router }); } + async function toggleWithReplies() { + os.apiWithDialog('following/update', { + userId: user.id, + withReplies: !user.withReplies, + }).then(() => { + user.withReplies = !user.withReplies; + }); + } + async function toggleNotify() { os.apiWithDialog('following/update', { userId: user.id, @@ -282,6 +291,10 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router // フォローしたとしても user.isFollowing はリアルタイム更新されないので不便なため //if (user.isFollowing) { menu = menu.concat([{ + icon: user.withReplies ? 'ph-envelope-open ph-bold pg-lg' : 'ph-envelope ph-bold pg-lg-off', + text: user.withReplies ? i18n.ts.hideRepliesToOthersInTimeline : i18n.ts.showRepliesToOthersInTimeline, + action: toggleWithReplies, + }, { icon: user.notify === 'none' ? 'ph-bell ph-bold pg-lg' : 'ph-bell ph-bold pg-lg-off', text: user.notify === 'none' ? i18n.ts.notifyNotes : i18n.ts.unnotifyNotes, action: toggleNotify, |