fix: 🐛

This commit is contained in:
codytseng
2025-01-13 23:56:41 +08:00
parent c62a82f673
commit 6bc2fde314
5 changed files with 10 additions and 5 deletions

View File

@@ -35,6 +35,9 @@ export function userIdToPubkey(userId: string) {
if (userId.startsWith('npub1')) {
const { data } = nip19.decode(userId as `npub1${string}`)
return data
} else if (userId.startsWith('nprofile1')) {
const { data } = nip19.decode(userId as `nprofile1${string}`)
return data.pubkey
}
return userId
}