From 19fc0a9351cb8b6c2310ec86986eab522ffb208a Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 8 Mar 2025 10:52:43 +0000 Subject: [PATCH 1/3] fix: Confirm follow prompt showing up when cancelling follow request --- packages/frontend/src/components/MkFollowButton.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index 42e8485f46..23d039bc58 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 }), From 91e15fafbf5e5b701a51e198b12be29d3b30fc62 Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 8 Mar 2025 11:54:19 +0000 Subject: [PATCH 2/3] upd: confirm dialog for undoing follow request --- locales/index.d.ts | 4 ++++ packages/frontend/src/components/MkFollowButton.vue | 10 ++++++++++ sharkey-locales/en-US.yml | 1 + 3 files changed, 15 insertions(+) diff --git a/locales/index.d.ts b/locales/index.d.ts index f125a9fa53..d8b60cc941 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 23d039bc58..2fadd39afc 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -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 7be3022f24..a164f6731c 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" From add1c717861cce17b85f24cbc82df1850862320f Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 8 Mar 2025 11:56:21 +0000 Subject: [PATCH 3/3] chore: lint --- packages/frontend/src/components/MkFollowButton.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index 2fadd39afc..93c3b481b2 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -128,7 +128,7 @@ async function onClick() { wait.value = false; return; } - + await misskeyApi('following/requests/cancel', { userId: props.user.id, });