diff --git a/locales/index.d.ts b/locales/index.d.ts index 2d51b994a6..4f75e0997c 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -11637,6 +11637,10 @@ export interface Locale extends ILocale { * Pending follow requests */ "pendingFollowRequests": string; + /** + * Are you sure you want to cancel your follow request? + */ + "undoFollowRequestConfirm": string; /** * Show quotes */ diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index 42e8485f46..93c3b481b2 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -106,7 +106,7 @@ async function onClick() { userId: props.user.id, }); } else { - if (defaultStore.state.alwaysConfirmFollow) { + if (defaultStore.state.alwaysConfirmFollow && !hasPendingFollowRequestFromYou.value) { const { canceled } = await os.confirm({ type: 'question', text: i18n.tsx.followConfirm({ name: props.user.name || props.user.username }), @@ -119,6 +119,16 @@ async function onClick() { } if (hasPendingFollowRequestFromYou.value) { + const { canceled } = await os.confirm({ + type: 'question', + text: i18n.ts.undoFollowRequestConfirm, + }); + + if (canceled) { + wait.value = false; + return; + } + await misskeyApi('following/requests/cancel', { userId: props.user.id, }); diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index 2e00f15b6f..738aa5eef4 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -161,6 +161,7 @@ severAllFollowRelations: "Break following relationships" severAllFollowRelationsConfirm: "Really break all follow relationships? This is irreversible! This will break {followingCount} following and {followersCount} follower relations on {instanceName}!" severAllFollowRelationsQueued: "Severing all follow relations with {host} queued." pendingFollowRequests: "Pending follow requests" +undoFollowRequestConfirm: "Are you sure you want to cancel your follow request?" showQuotes: "Show quotes" showReplies: "Show replies" showNonPublicNotes: "Show non-public"