mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-09 19:40:44 +00:00
homescreen refresh fix
This commit is contained in:
parent
9cb2049d6b
commit
805d7e1fa6
1 changed files with 7 additions and 4 deletions
|
|
@ -688,14 +688,17 @@ const HomeScreen = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const unsubscribe = navigation.addListener('focus', () => {
|
const unsubscribe = navigation.addListener('focus', () => {
|
||||||
|
// Only refresh continue watching section on focus
|
||||||
refreshContinueWatching();
|
refreshContinueWatching();
|
||||||
// Also refresh catalogs when returning to home screen
|
// Don't reload catalogs unless they haven't been loaded yet
|
||||||
// This ensures new addons are shown even if the context event was missed
|
// Catalogs will be refreshed through context updates when addons change
|
||||||
loadCatalogsProgressively();
|
if (catalogs.length === 0 && !catalogsLoading) {
|
||||||
|
loadCatalogsProgressively();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return unsubscribe;
|
return unsubscribe;
|
||||||
}, [navigation, refreshContinueWatching, loadCatalogsProgressively]);
|
}, [navigation, refreshContinueWatching, loadCatalogsProgressively, catalogs.length, catalogsLoading]);
|
||||||
|
|
||||||
// Memoize the loading screen to prevent unnecessary re-renders
|
// Memoize the loading screen to prevent unnecessary re-renders
|
||||||
const renderLoadingScreen = useMemo(() => {
|
const renderLoadingScreen = useMemo(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue