fix: added timeout for tabletstreamscreen to prevent blackscreen until backdrop is fetched

This commit is contained in:
tapframe 2026-01-06 00:12:00 +05:30
parent 4ce14ec4cc
commit 2d6b4afa2d

View file

@ -176,7 +176,36 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
return undefined;
}, [episodeImage, bannerImage, metadata?.poster, backdropError]);
// Animate backdrop when it loads, or animate content immediately if no backdrop
useEffect(() => {
if (backdropSource?.uri && !backdropLoaded && !backdropError) {
const timeoutId = setTimeout(() => {
leftPanelOpacity.value = withTiming(1, {
duration: 600,
easing: Easing.out(Easing.cubic)
});
leftPanelTranslateX.value = withTiming(0, {
duration: 600,
easing: Easing.out(Easing.cubic)
});
rightPanelOpacity.value = withDelay(200, withTiming(1, {
duration: 600,
easing: Easing.out(Easing.cubic)
}));
rightPanelTranslateX.value = withDelay(200, withTiming(0, {
duration: 600,
easing: Easing.out(Easing.cubic)
}));
}, 1000);
return () => clearTimeout(timeoutId);
}
}, [backdropSource?.uri, backdropLoaded, backdropError]);
useEffect(() => {
if (backdropSource?.uri && backdropLoaded) {
// Animate backdrop first