mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-01 03:28:27 +01:00
Feat/Show Splashcreen until UI loaded (#437)
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
||||
View,
|
||||
} from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { useSplashScreenLoading, useSplashScreenVisible } from "@/providers/SplashScreenProvider";
|
||||
|
||||
type ScrollingCollectionListSection = {
|
||||
type: "ScrollingCollectionList";
|
||||
@@ -146,6 +147,10 @@ export default function index() {
|
||||
staleTime: 60 * 1000,
|
||||
});
|
||||
|
||||
// show splash screen until query loaded
|
||||
useSplashScreenLoading(l1)
|
||||
const splashScreenVisible = useSplashScreenVisible()
|
||||
|
||||
const userViews = useMemo(
|
||||
() => data?.filter((l) => !settings?.hiddenLibraries?.includes(l.Id!)),
|
||||
[data, settings?.hiddenLibraries]
|
||||
@@ -399,7 +404,9 @@ export default function index() {
|
||||
</View>
|
||||
);
|
||||
|
||||
if (l1)
|
||||
// this spinner should only show up, when user navigates here
|
||||
// on launch the splash screen is used for loading
|
||||
if (l1 && !splashScreenVisible)
|
||||
return (
|
||||
<View className="justify-center items-center h-full">
|
||||
<Loader />
|
||||
|
||||
Reference in New Issue
Block a user