diff --git a/src/lib/profile.ts b/src/lib/profile.ts --- a/src/lib/profile.ts +++ b/src/lib/profile.ts @@ -12,12 +12,19 @@ const profileCache: Map = new Map() export async function resolveProfile(identifier: string) { + if (identifier === undefined) return undefined let profile = profileCache.get(identifier) if (profile === undefined) { console.log(`Resolving doc from slingshot: ${identifier}`) - const { did, handle, pds } = await Slingshot.call(blue.microcosm.identity.resolveMiniDoc, { - identifier: identifier as AtIdentifierString - }) + // TODO: Fix this + // const { did, handle, pds } = await Slingshot.call(blue.microcosm.identity.resolveMiniDoc, { + // identifier: identifier as AtIdentifierString + // }) + const response = await (await fetch(`https://plc.directory/${identifier}`)).json() + console.log(response) + const did = response.id + const pds = response.service[0].serviceEndpoint // This is not guaranteed to be a PDS, don't rely on it + const handle = response.alsoKnownAs[0].substring(5) profile = { did: did, handle: handle,