Skip to content

Commit 7b5465e

Browse files
committed
fix: Fix buggy loading skeleton
1 parent 3853d09 commit 7b5465e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/issues/IssuesListSkeleton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const IssuesListSkeleton = () => {
66
{[...Array(Math.floor(Math.random() * 2 + 2)).keys()].map(() => (
77
<>
88
<div className="animate-pulse h-2.5 my-0.5 w-28 rounded-full bg-gray-200 dark:bg-gray-700" />
9-
{[...Array(Math.floor(Math.random() * 5 + 1)).keys()].map(() => {
9+
{[...Array(Math.floor(Math.random() * 5 + 1)).keys()].map((_, i) => {
1010
return (
11-
<div className={clsx("animate-pulse block w-full p-1 bg-white border border-gray-200 rounded-lg shadow-sm dark:shadow-gray-700 dark:bg-gray-800 dark:border-gray-700 relative")}>
11+
<div key={i} className={clsx("animate-pulse block w-full p-1 bg-white border border-gray-200 rounded-lg shadow-sm dark:shadow-gray-700 dark:bg-gray-800 dark:border-gray-700 relative")}>
1212
<div className="h-2.5 my-0.5 w-52 mb-2 rounded-full bg-gray-200 dark:bg-gray-700" />
1313
<div className="flex flex-row justify-between gap-x-2">
1414
<div className="mt-1">

src/hooks/useMyIssues.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const useMyIssues = (additionalIssuesIds: number[], search: string) => {
2222
queryFn: ({ pageParam = 0 }) => getOpenIssues(additionalIssuesIds, pageParam * 100, 100),
2323
getNextPageParam: (lastPage, allPages) => (lastPage.length === 100 ? allPages.length : undefined),
2424
enabled: additionalIssuesIds.length > 0,
25+
keepPreviousData: additionalIssuesIds.length > 0,
2526
});
2627

2728
// auto fetch all pages

0 commit comments

Comments
 (0)