[#25] changed loading order + added condition to keep loading screen while loading calendar list

This commit is contained in:
Camille Moussu
2025-07-04 15:27:25 +02:00
parent 1b55f82e45
commit aae4d729f6
11 changed files with 216 additions and 86 deletions
+4 -1
View File
@@ -7,6 +7,7 @@ import { push } from "redux-first-history";
export function HandleLogin() {
const userData = useAppSelector((state) => state.user.userData);
const calendars = useAppSelector((state) => state.calendars);
const dispatch = useAppDispatch();
useEffect(() => {
const initiateLogin = async () => {
@@ -31,7 +32,9 @@ export function HandleLogin() {
if (!userData) {
return <Error />;
}
dispatch(push("/calendar"));
if (!calendars.pending) {
dispatch(push("/calendar"));
}
return <Loading />;
}