[#146] fix error in loading (#147)

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2025-09-25 16:52:51 +02:00
committed by GitHub
parent fc77c8a2ec
commit 58324cd8e0
4 changed files with 18 additions and 15 deletions
+5 -3
View File
@@ -86,9 +86,11 @@ export default function CalendarApp({
const tokens = useAppSelector((state) => state.user.tokens);
const dispatch = useAppDispatch();
if (!tokens) {
dispatch(push("/"));
}
useEffect(() => {
if (!tokens || !user) {
dispatch(push("/"));
}
}, [tokens, user]);
const calendars = useAppSelector((state) => state.calendars.list);
const tempcalendars =
+1 -1
View File
@@ -178,7 +178,7 @@ export default function CalendarSearch({
}) {
const dispatch = useAppDispatch();
const openpaasId =
useAppSelector((state) => state.user.userData.openpaasId) ?? "";
useAppSelector((state) => state.user.userData?.openpaasId) ?? "";
const calendars = useAppSelector((state) => state.calendars.list);
const [selectedCal, setSelectedCalendars] = useState<CalendarWithOwner[]>([]);