diff --git a/src/api/queries/get-transactions-query.ts b/src/api/queries/get-transactions-query.ts index 9ca5b5709..1236572fb 100644 --- a/src/api/queries/get-transactions-query.ts +++ b/src/api/queries/get-transactions-query.ts @@ -64,7 +64,9 @@ export const getTransactionsQuery = ( return mapped.filter((x) => x !== null).sort((a: any, b: any) => b.num - a.num); }, + staleTime: 60000, initialData: { pages: [], pageParams: [] }, initialPageParam: -1, - getNextPageParam: (_, __, lastPageParam) => lastPageParam + limit + getNextPageParam: (lastPage, __) => + lastPage ? (lastPage[lastPage.length - 1].num ?? 0) - 1 : -1 }); diff --git a/src/app/(dynamicPages)/profile/[username]/wallet/page.tsx b/src/app/(dynamicPages)/profile/[username]/wallet/page.tsx index b8f45f151..9d90c5009 100644 --- a/src/app/(dynamicPages)/profile/[username]/wallet/page.tsx +++ b/src/app/(dynamicPages)/profile/[username]/wallet/page.tsx @@ -1,4 +1,4 @@ -import { getAccountFullQuery } from "@/api/queries"; +import { getAccountFullQuery, getTransactionsQuery } from "@/api/queries"; import { notFound } from "next/navigation"; import { WalletHive } from "../_components"; import { dehydrate, HydrationBoundary } from "@tanstack/react-query"; @@ -18,6 +18,7 @@ export async function generateMetadata(props: Props, parent: ResolvingMetadata): export default async function EnginePage({ params }: Props) { const { username } = await params; const account = await getAccountFullQuery(username.replace("%40", "")).prefetch(); + await getTransactionsQuery(username, 20).prefetch(); if (!account) { return notFound();