Forces reset of the fetch guard when lastUpdate changes

This commit is contained in:
tapframe 2025-12-18 00:14:49 +05:30
parent baee619d73
commit af1b0b03d8

View file

@ -373,7 +373,22 @@ const HomeScreen = () => {
// Listen for catalog changes (addon additions/removals) and reload catalogs
useEffect(() => {
loadCatalogsProgressively();
// Skip initial mount (handled by the loadCatalogsProgressively effect)
if (lastUpdate === 0) return;
// Force reset the fetch guard to ensure refresh happens
isFetchingRef.current = false;
// Invalidate catalog settings cache so fresh settings are loaded
cachedCatalogSettings = null;
catalogSettingsCacheTimestamp = 0;
// Small delay to ensure previous fetch is fully stopped
const timer = setTimeout(() => {
loadCatalogsProgressively();
}, 100);
return () => clearTimeout(timer);
}, [lastUpdate, loadCatalogsProgressively]);
// One-time hint after skipping login in onboarding