[#34] added ky and condition to reconnect user on refresh

This commit is contained in:
Camille Moussu
2025-07-15 16:56:43 +02:00
parent aa3ecff9ef
commit 7507d09d72
9 changed files with 762 additions and 946 deletions
+6 -1
View File
@@ -19,12 +19,18 @@ import {
getCalendarRange,
} from "../../utils/dateUtils";
import { Calendars } from "../../features/Calendars/CalendarTypes";
import { push } from "redux-first-history";
export default function CalendarApp() {
const calendarRef = useRef<CalendarApi | null>(null);
const [selectedDate, setSelectedDate] = useState(new Date());
const tokens = useAppSelector((state) => state.user.tokens);
const dispatch = useAppDispatch();
if (!tokens) {
dispatch(push("/"));
}
const calendars = useAppSelector((state) => state.calendars.list);
const pending = useAppSelector((state) => state.calendars.pending);
const userId = useAppSelector((state) => state.user.userData.openpaasId);
@@ -75,7 +81,6 @@ export default function CalendarApp() {
if (!pending && rangeKey) {
dispatch(
getCalendarDetailAsync({
access_token: tokens.access_token,
calId: id,
match: {
start: formatDateToYYYYMMDDTHHMMSS(calendarRange.start),