From d365ea26dc89018c583833d1c0a5c4783c1efce4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 18 Mar 2023 18:09:16 -0500 Subject: [PATCH] Improve feed query --- src/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.ts b/src/client.ts index a2c7bc7..7deb3e6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -3,7 +3,7 @@ import { Author, RelayPool } from '@/deps.ts'; import { poolRelays } from './config.ts'; import type { Event, SignedEvent } from './event.ts'; -import { eventDateComparator } from './utils.ts'; +import { eventDateComparator, nostrNow } from './utils.ts'; const pool = new RelayPool(poolRelays); @@ -43,7 +43,7 @@ interface PaginationParams { /** Fetch events from people the user follows. */ function fetchFeed(event3: Event<3>, params: PaginationParams = {}): Promise[]> { - const limit = params.limit ?? 20; + const limit = Math.max(params.limit ?? 20, 40); const authors = event3.tags.filter((tag) => tag[0] === 'p').map((tag) => tag[1]); const results: SignedEvent<1>[] = []; authors.push(event3.pubkey); // see own events in feed @@ -54,7 +54,7 @@ function fetchFeed(event3: Event<3>, params: PaginationParams = {}): Promise