diff --git a/maternal-web/components/providers/ReduxProvider.tsx b/maternal-web/components/providers/ReduxProvider.tsx index 01d9e77..9c089db 100644 --- a/maternal-web/components/providers/ReduxProvider.tsx +++ b/maternal-web/components/providers/ReduxProvider.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useEffect, useRef } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { Provider } from 'react-redux'; import { PersistGate } from 'redux-persist/integration/react'; import { store, persistor } from '@/store/store'; @@ -9,8 +9,11 @@ import { CircularProgress, Box } from '@mui/material'; export function ReduxProvider({ children }: { children: React.ReactNode }) { const cleanupRef = useRef<(() => void) | null>(null); + const [isClient, setIsClient] = useState(false); useEffect(() => { + setIsClient(true); + // Setup network detection cleanupRef.current = setupNetworkDetection(store.dispatch); @@ -26,16 +29,18 @@ export function ReduxProvider({ children }: { children: React.ReactNode }) { - - + isClient ? ( + + + + ) : null } persistor={persistor} >