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 9c19cb03e..1ee562091 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 8a0430936..0fcf85ac0 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 557b257f6..313dddc5b 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(() => {