Skip to content

Commit

Permalink
increase feed length + decrease profile length
Browse files Browse the repository at this point in the history
  • Loading branch information
neb-b committed Jan 19, 2023
1 parent 729793e commit 098ef05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/core/nostr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const defaultRelays = [
"wss://nostr.oxtr.dev",
]

const GET_EVENTS_LIMIT = 50
const GET_EVENTS_LIMIT = 75
const TIMEOUT = 500

type ConnectionEventCbArg = {
Expand Down Expand Up @@ -94,18 +94,26 @@ export const getReplies = async (

export const getEventsFromPubkeys = async (
relays: Relay[],
pubkeys: string[]
pubkeys: string[],
limit?: number
): Promise<{
notes: NostrEvent[]
profiles: Record<string, NostrProfileEvent>
related: NostrEvent[]
reactions: Record<string, NostrReactionEvent[]>
}> =>
new Promise(async (resolve) => {
const notes = await getNostrEvents(relays, {
const filter = {
authors: pubkeys,
kinds: [nostrEventKinds.note, nostrEventKinds.repost],
})
}

if (limit) {
// @ts-expect-error
filter.limit = limit
}

const notes = await getNostrEvents(relays, filter)

const { related, profiles, reactions } = await getRelatedEvents(relays, notes)

Expand Down
2 changes: 1 addition & 1 deletion src/store/notesSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const doFetchProfileNotes = (pubkey: string) => async (dispatch: AppDispa

const relays = Object.values(relaysByUrl).filter((relay) => relaysLoadingByUrl[relay.url] !== true)

const { notes, profiles, related, reactions } = await getEventsFromPubkeys(relays, [pubkey])
const { notes, profiles, related, reactions } = await getEventsFromPubkeys(relays, [pubkey], 20)

dispatch(
updateNotesAndProfiles({
Expand Down

0 comments on commit 098ef05

Please sign in to comment.