feat: improve highlight source display and navigation
This commit is contained in:
parent
06adcdb2a8
commit
6350ddc224
4 changed files with 41 additions and 22 deletions
|
|
@ -18,7 +18,13 @@ export function tagNameEquals(tagName: string) {
|
|||
|
||||
export function generateBech32IdFromETag(tag: string[]) {
|
||||
try {
|
||||
const [, id, relay, , author] = tag
|
||||
const [, id, relay, markerOrPubkey, pubkey] = tag
|
||||
let author: string | undefined
|
||||
if (markerOrPubkey && isValidPubkey(markerOrPubkey)) {
|
||||
author = markerOrPubkey
|
||||
} else if (pubkey && isValidPubkey(pubkey)) {
|
||||
author = pubkey
|
||||
}
|
||||
return nip19.neventEncode({ id, relays: relay ? [relay] : undefined, author })
|
||||
} catch {
|
||||
return undefined
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue