summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarie <github@yuugi.dev>2025-03-21 16:46:47 +0000
committerMarie <github@yuugi.dev>2025-03-21 16:46:47 +0000
commitaa1691295bfaa2abd38f3c538bd400e7f37ff85b (patch)
treee31337650ee048fb310852625bb672bdd6498cf2
parentmerge: Make sure that scheduledNote* types are only showing on and off option... (diff)
parentchore: lint (diff)
downloadsharkey-aa1691295bfaa2abd38f3c538bd400e7f37ff85b.tar.gz
sharkey-aa1691295bfaa2abd38f3c538bd400e7f37ff85b.tar.bz2
sharkey-aa1691295bfaa2abd38f3c538bd400e7f37ff85b.zip
merge: Make confirm follow prompt not show up when cancelling a follow request (!941)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/941 Closes #822 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Hazelnoot <acomputerdog@gmail.com>
-rw-r--r--locales/index.d.ts4
-rw-r--r--packages/frontend/src/components/MkFollowButton.vue12
-rw-r--r--sharkey-locales/en-US.yml1
3 files changed, 16 insertions, 1 deletions
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
@@ -11638,6 +11638,10 @@ export interface Locale extends ILocale {
*/
"pendingFollowRequests": string;
/**
+ * Are you sure you want to cancel your follow request?
+ */
+ "undoFollowRequestConfirm": string;
+ /**
* Show quotes
*/
"showQuotes": string;
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"