mirror of
https://github.com/styppo/hamstr.git
synced 2024-10-18 05:23:28 +00:00
Fix rendering of @npub tags
This commit is contained in:
parent
aa8e844ecb
commit
856043bae2
@ -6,7 +6,7 @@
|
||||
import BaseMarkdown from 'components/Post/Renderer/BaseMarkdown.vue'
|
||||
import {useNostrStore} from 'src/nostr/NostrStore'
|
||||
import {TagType} from 'src/nostr/model/Event'
|
||||
import {hexToBech32, shortenBech32} from 'src/utils/utils'
|
||||
import {bech32ToHex, hexToBech32, shortenBech32} from 'src/utils/utils'
|
||||
import routerMixin from 'src/router/mixin'
|
||||
|
||||
export default {
|
||||
@ -31,14 +31,6 @@ export default {
|
||||
content = this.replaceTagRefs(content)
|
||||
return content
|
||||
},
|
||||
profiles() {
|
||||
const profiles = {}
|
||||
for (const pubkey of this.note.pubkeyRefs()) {
|
||||
// TODO batch request
|
||||
profiles[hexToBech32(pubkey, 'npub')] = this.nostr.getProfile(pubkey)
|
||||
}
|
||||
return profiles
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
replaceTagRefs(str) {
|
||||
@ -77,7 +69,7 @@ export default {
|
||||
})
|
||||
},
|
||||
renderProfileRef(bech32) {
|
||||
const profile = this.profiles[bech32]
|
||||
const profile = this.nostr.getProfile(bech32ToHex(bech32))
|
||||
const text = profile
|
||||
? profile.name
|
||||
: shortenBech32(bech32)
|
||||
|
Loading…
Reference in New Issue
Block a user