From 91e15fafbf5e5b701a51e198b12be29d3b30fc62 Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 8 Mar 2025 11:54:19 +0000 Subject: [PATCH] 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"