Request repost data

This commit is contained in:
KoalaSat 2023-01-29 22:46:34 +01:00
parent f22e0f730e
commit 950da9d0cb
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157
2 changed files with 9 additions and 4 deletions

View File

@ -35,7 +35,7 @@ export const usernamePubKey: (name: string | undefined, pubKey: string | undefin
export const formatPubKey: (pubKey: string | undefined) => string = (pubKey) => {
if (!pubKey) return ''
return `${pubKey.slice(0, 6)}...${pubKey.slice(-6)}`
return `${pubKey.slice(0, 8)}:${pubKey.slice(-8)}`
}
export const getNip05Domain: (nip05: string | undefined) => string | null = (nip05) => {

View File

@ -93,26 +93,31 @@ export const MyFeed: React.FC<MyFeedProps> = ({ navigation, setProfileCardPubKey
authors: notes.map((note) => note.pubkey ?? ''),
},
])
const notedIds = notes.map((note) => note.id ?? '')
const noteIds = notes.map((note) => note.id ?? '')
getLastReaction(database, { eventIds: notes.map((note) => note.id ?? '') }).then(
(lastReaction) => {
relayPool?.subscribe('homepage-reactions', [
{
kinds: [Kind.Reaction],
'#e': notedIds,
'#e': noteIds,
since: lastReaction?.created_at ?? 0,
},
])
},
)
const repostIds = notes.filter((note) => note.repost_id).map((note) => note.id ?? '')
getLastReply(database, { eventIds: notes.map((note) => note.id ?? '') }).then(
(lastReply) => {
relayPool?.subscribe('homepage-replies', [
{
kinds: [Kind.Text],
'#e': notedIds,
'#e': noteIds,
since: lastReply?.created_at ?? 0,
},
{
kinds: [Kind.Text],
'#e': repostIds
},
])
},
)