fix(compare): keep chart data when a client refetch fails #12

Merged
tudor merged 1 commits from fix/compare-chart-refetch-resilience into main 2026-07-06 07:27:04 +00:00
+3 -1
View File
@@ -111,8 +111,10 @@ export function ComparisonView({
setComparisonData(data.comparison); setComparisonData(data.comparison);
}) })
.catch((err) => { .catch((err) => {
// Keep whatever we already have (SSR data or a previous fetch) rather
// than blanking the chart — a transient refetch failure shouldn't
// destroy a working comparison the user is looking at.
console.error('Failed to fetch comparison:', err); console.error('Failed to fetch comparison:', err);
setComparisonData(null);
}); });
} else { } else {
setComparisonData(null); setComparisonData(null);