Skip to content

Commit 200fc47

Browse files
Set maximum number of repos to display to 100
1 parent b21554c commit 200fc47

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/web/src/app/[domain]/components/homepage/repositorySnapshot.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { RepositoryCarousel } from "./repositoryCarousel";
55
import { useDomain } from "@/hooks/useDomain";
66
import { useQuery } from "@tanstack/react-query";
77
import { unwrapServiceError } from "@/lib/utils";
8-
import { getRepos } from "@/actions";
8+
import { getRepos } from "@/app/api/(client)/client";
99
import { env } from "@/env.mjs";
1010
import { Skeleton } from "@/components/ui/skeleton";
1111
import {
@@ -22,14 +22,16 @@ interface RepositorySnapshotProps {
2222
repos: RepositoryQuery[];
2323
}
2424

25+
const MAX_REPOS_TO_DISPLAY_IN_CAROUSEL = 100;
26+
2527
export function RepositorySnapshot({
2628
repos: initialRepos,
2729
}: RepositorySnapshotProps) {
2830
const domain = useDomain();
2931

3032
const { data: repos, isPending, isError } = useQuery({
3133
queryKey: ['repos', domain],
32-
queryFn: () => unwrapServiceError(getRepos(domain)),
34+
queryFn: () => unwrapServiceError(getRepos()),
3335
refetchInterval: env.NEXT_PUBLIC_POLLING_INTERVAL_MS,
3436
placeholderData: initialRepos,
3537
});
@@ -78,7 +80,9 @@ export function RepositorySnapshot({
7880
</Link>
7981
{` indexed`}
8082
</span>
81-
<RepositoryCarousel repos={indexedRepos} />
83+
<RepositoryCarousel
84+
repos={indexedRepos.slice(0, MAX_REPOS_TO_DISPLAY_IN_CAROUSEL)}
85+
/>
8286
{process.env.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT === "demo" && (
8387
<p className="text-sm text-muted-foreground text-center">
8488
Interested in using Sourcebot on your code? Check out our{' '}

0 commit comments

Comments
 (0)