From e211d4e0cbb3ba4ca1c4bbd0d2edcad2f4d32adf Mon Sep 17 00:00:00 2001 From: atsuchan <83960488+atsu1125@users.noreply.github.com> Date: Fri, 24 Feb 2023 13:08:06 +0900 Subject: [PATCH] Add dialog to remove follower (#9718) --- locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + packages/frontend/src/scripts/get-user-menu.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/locales/en-US.yml b/locales/en-US.yml index 9c19cb03ea..1ee5620916 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -805,6 +805,7 @@ lastCommunication: "Last communication" resolved: "Resolved" unresolved: "Unresolved" breakFollow: "Remove follower" +breakFollowConfirm: "Are you sure want to remove follower?" itsOn: "Enabled" itsOff: "Disabled" emailRequiredForSignup: "Require email address for sign-up" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 8a04309360..0fcf85ac0d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -812,6 +812,7 @@ lastCommunication: "直近の通信" resolved: "解決済み" unresolved: "未解決" breakFollow: "フォロワーを解除" +breakFollowConfirm: "フォロワー解除しますか?" itsOn: "オンになっています" itsOff: "オフになっています" emailRequiredForSignup: "アカウント登録にメールアドレスを必須にする" diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index 557b257f62..313dddc5b1 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -102,6 +102,8 @@ export function getUserMenu(user, router: Router = mainRouter) { } async function invalidateFollow() { + if (!await getConfirmed(i18n.ts.breakFollowConfirm)) return; + os.apiWithDialog('following/invalidate', { userId: user.id, }).then(() => {