1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-04 15:26:08 +02:00

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
5 changed files with 69 additions and 36 deletions

View File

@@ -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) {

View File

@@ -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();
});
}