diff --git a/client/src/AppContainer.jsx b/client/src/AppContainer.jsx
index ad10e767..9a41dee1 100644
--- a/client/src/AppContainer.jsx
+++ b/client/src/AppContainer.jsx
@@ -9,13 +9,14 @@ import { Helmet } from "react-helmet";
import { useLocation } from "react-router-dom";
const ErrorComponent = ({ errorMessage }) => (
-
{errorMessage}
+ {errorMessage}
);
const AppContainer = () => {
const location = useLocation();
const [store, setStore] = useState(null);
- const [loading, setLoading] = useState(true);
+ const [storeloading, setStoreloading] = useState(true);
+ const [serverStatus, setServerStatus] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
@@ -25,7 +26,7 @@ const AppContainer = () => {
} catch (err) {
setError("Server is down. Please try again later.");
} finally {
- setLoading(false);
+ setServerStatus(false);
}
};
@@ -43,17 +44,21 @@ const AppContainer = () => {
} catch (err) {
setError(`Error initializing the app: ${err.message}`);
} finally {
- setLoading(false);
+ setStoreloading(false);
}
};
initializeStore();
}, []);
- if (loading || error) {
+ if ((storeloading && serverStatus && !error) || error) {
return (
-
- {loading ?
:
}
+
+ {storeloading && serverStatus && !error ? (
+
+ ) : (
+
+ )}
);
}