Fix api creation on reload

This commit is contained in:
Prayag Prajapati committed 2023-11-20 19:18:43 +05:30
1 parent 27e2ee971d
commit 6e22c545b1
4 files changed
+8 -21

No files matched your search

+2 -4
View File
@@ -148,7 +148,7 @@ const LogicalRoute = () => {
const LoginRoute = () => {
const navigate = useNavigate();
const [api] = useApi((state) => [state.api]);
console.log(api);
const usersList = useQuery({
queryKey: ["public-users"],
queryFn: async () => {
@@ -160,10 +160,8 @@ const LoginRoute = () => {
if (usersList.isSuccess && !usersList.isFetching) {
if (usersList.data.length > 0) {
navigate("/login/users");
// <Navigate replace to="/login/users" />;
} else {
navigate("/login/manual");
// <Navigate replace to="/login/manual" />;
}
}
return (
@@ -175,7 +173,7 @@ const LoginRoute = () => {
transform: "translate(-50%, -50%)",
}}
>
<CircularProgress size={84} thickness={1} />
<CircularProgress size={72} thickness={1.4} />
</div>
);
};