mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 00:32:04 +00:00
Refactor loading state logic in HomeScreen to improve data display handling. Update isLoading calculation to show full-screen loader only when no data is available, enhancing user experience during content loading.
This commit is contained in:
parent
8481bb5609
commit
e2403ecd71
1 changed files with 9 additions and 5 deletions
|
|
@ -249,11 +249,15 @@ const HomeScreen = () => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Only count feature section as loading if it's enabled in settings
|
// Only count feature section as loading if it's enabled in settings
|
||||||
// For catalogs, we show them progressively, so only show loading if no catalogs are loaded yet
|
// Render the screen immediately and let placeholders/skeletons handle progressive loading
|
||||||
const isLoading = useMemo(() =>
|
const isLoading = useMemo(() => {
|
||||||
(showHeroSection ? featuredLoading : false) || (catalogsLoading && catalogs.length === 0),
|
// Show a full-screen loader only if we literally have no data to display yet
|
||||||
[showHeroSection, featuredLoading, catalogsLoading, catalogs.length]
|
const noHeroSection = !showHeroSection;
|
||||||
);
|
const noFeaturedData = !featuredContent && featuredLoading;
|
||||||
|
const noCatalogsReady = catalogs.length === 0 && catalogsLoading;
|
||||||
|
|
||||||
|
return noHeroSection && noCatalogsReady && noFeaturedData;
|
||||||
|
}, [showHeroSection, featuredContent, featuredLoading, catalogsLoading, catalogs.length]);
|
||||||
|
|
||||||
// React to settings changes
|
// React to settings changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue