From f6ba5cfaf4b147d7b9dc6349fea250f1fdf1088d Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 3 Oct 2023 20:26:11 +0900 Subject: merge: timeline 1 --- packages/frontend/src/scripts/get-user-menu.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'packages/frontend/src/scripts') 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, -- cgit v1.2.3-freya