From af1b0b03d82d7d517619a9c4687b6da5e93371c3 Mon Sep 17 00:00:00 2001 From: tapframe Date: Thu, 18 Dec 2025 00:14:49 +0530 Subject: [PATCH] Forces reset of the fetch guard when lastUpdate changes --- src/screens/HomeScreen.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index b1d0b590..e748dde6 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -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