diff --git a/src/components/Calendar/utils/calendarUtils.ts b/src/components/Calendar/utils/calendarUtils.ts
index 88dc632..70dd735 100644
--- a/src/components/Calendar/utils/calendarUtils.ts
+++ b/src/components/Calendar/utils/calendarUtils.ts
@@ -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,
+ })
+ );
+ }
});
}
};
diff --git a/src/features/Events/EventModal.tsx b/src/features/Events/EventModal.tsx
index 328d5ea..a4674ee 100644
--- a/src/features/Events/EventModal.tsx
+++ b/src/features/Events/EventModal.tsx
@@ -270,7 +270,7 @@ function EventPopover({
const handleDeleteVideoConference = () => {
// Remove video conference footer from description
const updatedDescription = description.replace(
- /\n\nVisio: https?:\/\/[^\s]+/,
+ /\nVisio: https?:\/\/[^\s]+/,
""
);
setDescription(updatedDescription);
@@ -500,7 +500,6 @@ function EventPopover({
/>
}
label="Mark as important"
- sx={{ padding: "0 8px 0 0" }}
/>
}
label="All day"
- sx={{ padding: "0 8px 0 0" }}
/>
-
+
}
onClick={handleAddVideoConference}
diff --git a/src/utils/__test__/videoConferenceUtils.test.ts b/src/utils/__test__/videoConferenceUtils.test.ts
index c30f60c..32a105a 100644
--- a/src/utils/__test__/videoConferenceUtils.test.ts
+++ b/src/utils/__test__/videoConferenceUtils.test.ts
@@ -49,7 +49,7 @@ describe("videoConferenceUtils", () => {
const description = "";
const meetingLink = "https://meet.linagora.com/abc-defg-hij";
const result = addVideoConferenceToDescription(description, meetingLink);
- expect(result).toBe("\n\nVisio: https://meet.linagora.com/abc-defg-hij");
+ expect(result).toBe("\nVisio: https://meet.linagora.com/abc-defg-hij");
});
it("should add video conference footer to existing description", () => {
@@ -57,7 +57,7 @@ describe("videoConferenceUtils", () => {
const meetingLink = "https://meet.linagora.com/abc-defg-hij";
const result = addVideoConferenceToDescription(description, meetingLink);
expect(result).toBe(
- "This is a meeting description.\n\nVisio: https://meet.linagora.com/abc-defg-hij"
+ "This is a meeting description.\nVisio: https://meet.linagora.com/abc-defg-hij"
);
});
});
@@ -65,7 +65,7 @@ describe("videoConferenceUtils", () => {
describe("extractVideoConferenceFromDescription", () => {
it("should extract video conference link from description", () => {
const description =
- "Meeting description.\n\nVisio: https://meet.linagora.com/abc-defg-hij";
+ "Meeting description.\nVisio: https://meet.linagora.com/abc-defg-hij";
const result = extractVideoConferenceFromDescription(description);
expect(result).toBe("https://meet.linagora.com/abc-defg-hij");
});
diff --git a/src/utils/videoConferenceUtils.ts b/src/utils/videoConferenceUtils.ts
index 8eff898..d2ee7f2 100644
--- a/src/utils/videoConferenceUtils.ts
+++ b/src/utils/videoConferenceUtils.ts
@@ -42,7 +42,7 @@ export function addVideoConferenceToDescription(
description: string,
meetingLink: string
): string {
- const footer = `\n\nVisio: ${meetingLink}`;
+ const footer = `\nVisio: ${meetingLink}`;
return description + footer;
}