fix(frontend): フォロー申請のキャンセル時に確認ダイアログを出すように (#16834)

* fix(frontend): フォロー申請のキャンセル時に確認ダイアログを出すように

* Update Changelog

* fix: 注釈は書かない
This commit is contained in:
かっこかり 2025-11-26 13:07:28 +09:00 committed by GitHub
parent e0e17a78f1
commit 0c5f61721a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 69 additions and 36 deletions

View File

@ -15,6 +15,7 @@
- Fix: 投稿フォームのリセットボタンで注釈がリセットされない問題を修正 - Fix: 投稿フォームのリセットボタンで注釈がリセットされない問題を修正
- Fix: PlayのAiScriptバージョン判定v0.x系・v1.x系の判定が正しく動作しない問題を修正 - Fix: PlayのAiScriptバージョン判定v0.x系・v1.x系の判定が正しく動作しない問題を修正
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/1129) (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/1129)
- Fix: フォロー申請をキャンセルする際の確認ダイアログの文言が不正確な問題を修正
### Server ### Server
- Enhance: `clips/my-favorites` APIがページネーションに対応しました - Enhance: `clips/my-favorites` APIがページネーションに対応しました

8
locales/index.d.ts vendored
View File

@ -350,6 +350,14 @@ export interface Locale extends ILocale {
* {name} * {name}
*/ */
"unfollowConfirm": ParameterizedString<"name">; "unfollowConfirm": ParameterizedString<"name">;
/**
* {name}
*/
"cancelFollowRequestConfirm": ParameterizedString<"name">;
/**
* {name}
*/
"rejectFollowRequestConfirm": ParameterizedString<"name">;
/** /**
* *
*/ */

View File

@ -83,6 +83,8 @@ files: "ファイル"
download: "ダウンロード" download: "ダウンロード"
driveFileDeleteConfirm: "ファイル「{name}」を削除しますか?このファイルを使用した一部のコンテンツも削除されます。" driveFileDeleteConfirm: "ファイル「{name}」を削除しますか?このファイルを使用した一部のコンテンツも削除されます。"
unfollowConfirm: "{name}のフォローを解除しますか?" unfollowConfirm: "{name}のフォローを解除しますか?"
cancelFollowRequestConfirm: "{name}へのフォロー申請をキャンセルしますか?"
rejectFollowRequestConfirm: "{name}からのフォロー申請を拒否しますか?"
exportRequested: "エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。" exportRequested: "エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。"
importRequested: "インポートをリクエストしました。これには時間がかかる場合があります。" importRequested: "インポートをリクエストしました。これには時間がかかる場合があります。"
lists: "リスト" lists: "リスト"

View File

@ -102,6 +102,21 @@ async function onClick() {
await misskeyApi('following/delete', { await misskeyApi('following/delete', {
userId: props.user.id, 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 { } else {
if (prefer.s.alwaysConfirmFollow) { if (prefer.s.alwaysConfirmFollow) {
const { canceled } = await os.confirm({ const { canceled } = await os.confirm({
@ -115,12 +130,6 @@ async function onClick() {
} }
} }
if (hasPendingFollowRequestFromYou.value) {
await misskeyApi('following/requests/cancel', {
userId: props.user.id,
});
hasPendingFollowRequestFromYou.value = false;
} else {
await misskeyApi('following/create', { await misskeyApi('following/create', {
userId: props.user.id, userId: props.user.id,
withReplies: prefer.s.defaultFollowWithReplies, withReplies: prefer.s.defaultFollowWithReplies,
@ -151,7 +160,6 @@ async function onClick() {
claimAchievement('following300'); claimAchievement('following300');
} }
} }
}
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} finally { } finally {

View File

@ -63,14 +63,28 @@ function accept(user: Misskey.entities.UserLite) {
}); });
} }
function reject(user: Misskey.entities.UserLite) { async function reject(user: Misskey.entities.UserLite) {
os.apiWithDialog('following/requests/reject', { userId: user.id }).then(() => { 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(); paginator.reload();
}); });
} }
function cancel(user: Misskey.entities.UserLite) { async function cancel(user: Misskey.entities.UserLite) {
os.apiWithDialog('following/requests/cancel', { userId: user.id }).then(() => { 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(); paginator.reload();
}); });
} }