diff --git a/src/features/messages/queries/parse.ts b/src/features/messages/queries/parse.ts index 487ba5b..25bfac5 100644 --- a/src/features/messages/queries/parse.ts +++ b/src/features/messages/queries/parse.ts @@ -31,7 +31,9 @@ export function parseMessageStubResult( .flat() .map((m) => parseMessageStub(multiProvider, scrapedChains, m)) .filter((m): m is MessageStub => !!m) - .sort((a, b) => b.origin.timestamp - a.origin.timestamp); + .sort((a, b) => b.origin.timestamp - a.origin.timestamp) + .filter((m) => Date.now() - m.origin.timestamp < 1000 * 60 * 60) // filter out messages older than 1 hour + .slice(0, 20); } export function parseMessageQueryResult( diff --git a/src/features/messages/queries/useMessageQuery.ts b/src/features/messages/queries/useMessageQuery.ts index 08e26b7..4760a54 100644 --- a/src/features/messages/queries/useMessageQuery.ts +++ b/src/features/messages/queries/useMessageQuery.ts @@ -18,7 +18,7 @@ import { parseMessageQueryResult, parseMessageStubResult } from './parse'; const SEARCH_AUTO_REFRESH_DELAY = 15_000; // 15s const MSG_AUTO_REFRESH_DELAY = 10_000; // 10s -const LATEST_QUERY_LIMIT = 20; +const LATEST_QUERY_LIMIT = 100; const SEARCH_QUERY_LIMIT = 50; export function isValidSearchQuery(input: string, allowAddress?: boolean) {