homescreen refresh fix

This commit is contained in:
tapframe 2025-06-20 03:33:56 +05:30
parent 9cb2049d6b
commit 805d7e1fa6

View file

@ -688,14 +688,17 @@ const HomeScreen = () => {
useEffect(() => {
const unsubscribe = navigation.addListener('focus', () => {
// Only refresh continue watching section on focus
refreshContinueWatching();
// Also refresh catalogs when returning to home screen
// This ensures new addons are shown even if the context event was missed
loadCatalogsProgressively();
// Don't reload catalogs unless they haven't been loaded yet
// Catalogs will be refreshed through context updates when addons change
if (catalogs.length === 0 && !catalogsLoading) {
loadCatalogsProgressively();
}
});
return unsubscribe;
}, [navigation, refreshContinueWatching, loadCatalogsProgressively]);
}, [navigation, refreshContinueWatching, loadCatalogsProgressively, catalogs.length, catalogsLoading]);
// Memoize the loading screen to prevent unnecessary re-renders
const renderLoadingScreen = useMemo(() => {