diff --git a/CHANGELOG.md b/CHANGELOG.md index 134a594..aeda1ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added + +- Show "Alias" badge on profile page if account has aliases. + ### Changed - Use `/feeds/users/{username}` path for user's Atom feed. diff --git a/src/api/users.ts b/src/api/users.ts index 8690431..f424ca3 100644 --- a/src/api/users.ts +++ b/src/api/users.ts @@ -352,3 +352,13 @@ export async function createIdentityProof( return data } } + +export async function getAliases(profileId: string): Promise { + const url = `${BACKEND_URL}/api/v1/accounts/${profileId}/aliases` + const response = await http(url) + const data = await response.json() + if (response.status !== 200) { + throw new Error(data.error_description) + } + return data +} diff --git a/src/views/Profile.vue b/src/views/Profile.vue index f6b335b..412788f 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -13,6 +13,13 @@
+
+ Alias +
Follows you
Subscription
Subscriber
@@ -257,6 +264,7 @@ import { } from "@/api/relationships" import { getReceivedSubscriptions } from "@/api/subscriptions-common" import { + getAliases, getProfile, lookupProfile, Permissions, @@ -288,6 +296,7 @@ const { instance, getActorAddress } = $(useInstanceInfo()) let profile = $ref(null) let relationship = $ref(null) +let aliases = $ref([]) let profileMenuVisible = $ref(false) @@ -327,6 +336,9 @@ onMounted(async () => { profile.id, ) } + if (profile.identity_proofs.length > 0) { + aliases = await getAliases(profile.id) + } await switchTab("posts") isLoading = false })