feat: add notification for nip42

This commit is contained in:
2024-09-22 09:40:07 +07:00
parent 2c7f3685b6
commit a5574bef6c
10 changed files with 156 additions and 56 deletions

View File

@@ -27,8 +27,6 @@ export function useEvent(id: string) {
}
}
console.log(relayHint);
// Build query
if (relayHint?.length) {
query = await commands.getEventFrom(normalizeId, relayHint);

View File

@@ -17,18 +17,15 @@ export function useProfile(pubkey: string, embed?: string) {
}
let normalizeId = pubkey.replace("nostr:", "").replace(/[^\w\s]/gi, "");
let relayHint: string;
if (normalizeId.startsWith("nprofile")) {
const decoded = nip19.decode(normalizeId);
if (decoded.type === "nprofile") {
relayHint = decoded.data.relays[0];
normalizeId = decoded.data.pubkey;
}
}
console.log(relayHint);
const query = await commands.getProfile(normalizeId);
if (query.status === "ok") {