feat: negentropy progress

This commit is contained in:
2024-10-25 14:57:12 +07:00
parent 055d73c829
commit 5ab2b1ae31
27 changed files with 769 additions and 663 deletions

View File

@@ -16,17 +16,17 @@ export function useProfile(pubkey: string, embed?: string) {
return metadata;
}
let normalizeId = pubkey.replace("nostr:", "").replace(/[^\w\s]/gi, "");
let normalizedId = pubkey.replace("nostr:", "").replace(/[^\w\s]/gi, "");
if (normalizeId.startsWith("nprofile")) {
const decoded = nip19.decode(normalizeId);
if (normalizedId.startsWith("nprofile")) {
const decoded = nip19.decode(normalizedId);
if (decoded.type === "nprofile") {
normalizeId = decoded.data.pubkey;
normalizedId = decoded.data.pubkey;
}
}
const query = await commands.getProfile(normalizeId);
const query = await commands.getProfile(normalizedId);
if (query.status === "ok") {
return JSON.parse(query.data) as Metadata;