fix: improve video conference link positioning and null safety

- Fix calendarUtils.ts null safety for calendars[id] access
- Update video conference link to be added on line 2 instead of line 3
- Update regex in handleDeleteVideoConference to match new format
- Update all test cases for videoConferenceUtils to match new format
- Add null checks in updateCalsDetails function
This commit is contained in:
lenhanphung
2025-10-03 10:46:34 +07:00
parent ff54840ac8
commit cea576e5e8
4 changed files with 19 additions and 19 deletions
+13 -11
View File
@@ -74,7 +74,7 @@ export const extractEvents = (
) => {
let filteredEvents: CalendarEvent[] = [];
selectedCalendars.forEach((id) => {
if (calendars[id].events) {
if (calendars[id] && calendars[id].events) {
filteredEvents = filteredEvents
.concat(
Object.keys(calendars[id].events).map(
@@ -118,16 +118,18 @@ export const updateCalsDetails = (
if (rangeKey !== previousRangeKey) {
selectedCalendars?.forEach((id) => {
dispatch(
getCalendarDetailAsync({
calId: id,
match: {
start: formatDateToYYYYMMDDTHHMMSS(calendarRange.start),
end: formatDateToYYYYMMDDTHHMMSS(calendarRange.end),
},
calType,
})
);
if (id) {
dispatch(
getCalendarDetailAsync({
calId: id,
match: {
start: formatDateToYYYYMMDDTHHMMSS(calendarRange.start),
end: formatDateToYYYYMMDDTHHMMSS(calendarRange.end),
},
calType,
})
);
}
});
}
};