Always show overlay on mount

There were cases where the overlay got closed instead of opened on the first mount
This commit is contained in:
schroda
2024-12-09 04:41:50 +01:00
parent b9313fe168
commit 3839b438eb

View File

@@ -272,13 +272,9 @@ export const Reader = () => {
return () => setOverride({ status: false, value: null });
}, [isOverlayVisible, setIsOverlayVisible, scrollElementRef.current]);
const [isInitialLoad, setIsInitialLoad] = useState(true);
useEffect(() => {
if (isInitialLoad) {
setIsOverlayVisible(isLoading || !!error);
setIsInitialLoad(false);
}
}, [isLoading, error]);
setIsOverlayVisible(true);
}, []);
if (isLoading) {
return (