Skip to content

Commit ee7295a

Browse files
committed
fix(nodes-list): improve loading state handling and add placeholder data for refetching
1 parent db17e03 commit ee7295a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

dashboard/src/components/nodes/nodes-list.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export default function NodesList() {
111111
retry: 1,
112112
refetchOnMount: true,
113113
refetchOnWindowFocus: true,
114+
placeholderData: previousData => previousData,
114115
},
115116
})
116117

@@ -695,7 +696,7 @@ export default function NodesList() {
695696
/>
696697
)}
697698

698-
{!showLoadingSpinner && !showPageLoadingSkeletons && nodesData.length === 0 && !hasActiveFilters && totalNodes === 0 && (
699+
{!showLoadingSpinner && !showPageLoadingSkeletons && !isFetching && nodesData.length === 0 && !hasActiveFilters && totalNodes === 0 && (
699700
<Card className="mb-12">
700701
<CardContent className="p-8 text-center">
701702
<div className="space-y-4">
@@ -712,7 +713,7 @@ export default function NodesList() {
712713
</Card>
713714
)}
714715

715-
{!showLoadingSpinner && !showPageLoadingSkeletons && nodesData.length === 0 && hasActiveFilters && (
716+
{!showLoadingSpinner && !showPageLoadingSkeletons && !isFetching && nodesData.length === 0 && hasActiveFilters && (
716717
<Card className="mb-12">
717718
<CardContent className="p-8 text-center">
718719
<div className="space-y-4">

0 commit comments

Comments
 (0)