From 0c5f61721a1f149aeed4a2d7d500b3aa983892b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:07:28 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E3=83=95=E3=82=A9=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E7=94=B3=E8=AB=8B=E3=81=AE=E3=82=AD=E3=83=A3=E3=83=B3?= =?UTF-8?q?=E3=82=BB=E3=83=AB=E6=99=82=E3=81=AB=E7=A2=BA=E8=AA=8D=E3=83=80?= =?UTF-8?q?=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=82=92=E5=87=BA=E3=81=99?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=20(#16834)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): フォロー申請のキャンセル時に確認ダイアログを出すように * Update Changelog * fix: 注釈は書かない --- CHANGELOG.md | 1 + locales/index.d.ts | 8 +++ locales/ja-JP.yml | 2 + .../src/components/MkFollowButton.vue | 72 ++++++++++--------- .../frontend/src/pages/follow-requests.vue | 22 ++++-- 5 files changed, 69 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a625dd5d96..29da92c864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Fix: 投稿フォームのリセットボタンで注釈がリセットされない問題を修正 - Fix: PlayのAiScriptバージョン判定(v0.x系・v1.x系の判定)が正しく動作しない問題を修正 (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/1129) +- Fix: フォロー申請をキャンセルする際の確認ダイアログの文言が不正確な問題を修正 ### Server - Enhance: `clips/my-favorites` APIがページネーションに対応しました diff --git a/locales/index.d.ts b/locales/index.d.ts index ab17f8b736..7f0efd22e8 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -350,6 +350,14 @@ export interface Locale extends ILocale { * {name}のフォローを解除しますか? */ "unfollowConfirm": ParameterizedString<"name">; + /** + * {name}へのフォロー申請をキャンセルしますか? + */ + "cancelFollowRequestConfirm": ParameterizedString<"name">; + /** + * {name}からのフォロー申請を拒否しますか? + */ + "rejectFollowRequestConfirm": ParameterizedString<"name">; /** * エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。 */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index a1f9af8edc..8e4a52b68d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -83,6 +83,8 @@ files: "ファイル" download: "ダウンロード" driveFileDeleteConfirm: "ファイル「{name}」を削除しますか?このファイルを使用した一部のコンテンツも削除されます。" unfollowConfirm: "{name}のフォローを解除しますか?" +cancelFollowRequestConfirm: "{name}へのフォロー申請をキャンセルしますか?" +rejectFollowRequestConfirm: "{name}からのフォロー申請を拒否しますか?" exportRequested: "エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。" importRequested: "インポートをリクエストしました。これには時間がかかる場合があります。" lists: "リスト" diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index c7361a19c6..ba21fe82e4 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -102,6 +102,21 @@ async function onClick() { await misskeyApi('following/delete', { userId: props.user.id, }); + } else if (hasPendingFollowRequestFromYou.value) { + const { canceled } = await os.confirm({ + type: 'question', + text: i18n.tsx.cancelFollowRequestConfirm({ name: props.user.name || props.user.username }), + }); + + if (canceled) { + wait.value = false; + return; + } + + await misskeyApi('following/requests/cancel', { + userId: props.user.id, + }); + hasPendingFollowRequestFromYou.value = false; } else { if (prefer.s.alwaysConfirmFollow) { const { canceled } = await os.confirm({ @@ -115,41 +130,34 @@ async function onClick() { } } - if (hasPendingFollowRequestFromYou.value) { - await misskeyApi('following/requests/cancel', { - userId: props.user.id, - }); - hasPendingFollowRequestFromYou.value = false; - } else { - await misskeyApi('following/create', { - userId: props.user.id, - withReplies: prefer.s.defaultFollowWithReplies, - }); - emit('update:user', { - ...props.user, - withReplies: prefer.s.defaultFollowWithReplies, - }); - hasPendingFollowRequestFromYou.value = true; + await misskeyApi('following/create', { + userId: props.user.id, + withReplies: prefer.s.defaultFollowWithReplies, + }); + emit('update:user', { + ...props.user, + withReplies: prefer.s.defaultFollowWithReplies, + }); + hasPendingFollowRequestFromYou.value = true; - if ($i == null) { - wait.value = false; - return; - } + if ($i == null) { + wait.value = false; + return; + } - claimAchievement('following1'); + claimAchievement('following1'); - if ($i.followingCount >= 10) { - claimAchievement('following10'); - } - if ($i.followingCount >= 50) { - claimAchievement('following50'); - } - if ($i.followingCount >= 100) { - claimAchievement('following100'); - } - if ($i.followingCount >= 300) { - claimAchievement('following300'); - } + if ($i.followingCount >= 10) { + claimAchievement('following10'); + } + if ($i.followingCount >= 50) { + claimAchievement('following50'); + } + if ($i.followingCount >= 100) { + claimAchievement('following100'); + } + if ($i.followingCount >= 300) { + claimAchievement('following300'); } } } catch (err) { diff --git a/packages/frontend/src/pages/follow-requests.vue b/packages/frontend/src/pages/follow-requests.vue index 35e259a571..ba24d7abc6 100644 --- a/packages/frontend/src/pages/follow-requests.vue +++ b/packages/frontend/src/pages/follow-requests.vue @@ -63,14 +63,28 @@ function accept(user: Misskey.entities.UserLite) { }); } -function reject(user: Misskey.entities.UserLite) { - os.apiWithDialog('following/requests/reject', { userId: user.id }).then(() => { +async function reject(user: Misskey.entities.UserLite) { + const { canceled } = await os.confirm({ + type: 'question', + text: i18n.tsx.rejectFollowRequestConfirm({ name: user.name || user.username }), + }); + + if (canceled) return; + + await os.apiWithDialog('following/requests/reject', { userId: user.id }).then(() => { paginator.reload(); }); } -function cancel(user: Misskey.entities.UserLite) { - os.apiWithDialog('following/requests/cancel', { userId: user.id }).then(() => { +async function cancel(user: Misskey.entities.UserLite) { + const { canceled } = await os.confirm({ + type: 'question', + text: i18n.tsx.cancelFollowRequestConfirm({ name: user.name || user.username }), + }); + + if (canceled) return; + + await os.apiWithDialog('following/requests/cancel', { userId: user.id }).then(() => { paginator.reload(); }); }