From 8f8ed4d80dcd170593b93d30bc741f9ad62e6331 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Fri, 31 Mar 2023 17:12:28 -0400 Subject: [PATCH] Show proper default destination calendar (#7644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make destination calendar immutable * Add comment --------- Co-authored-by: Omar López --- packages/core/CalendarManager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/CalendarManager.ts b/packages/core/CalendarManager.ts index 69eae44131..241c8239d0 100644 --- a/packages/core/CalendarManager.ts +++ b/packages/core/CalendarManager.ts @@ -77,9 +77,11 @@ export const getConnectedCalendars = async ( }, }; } - if (destinationCalendar) { + // HACK https://github.com/calcom/cal.com/pull/7644/files#r1131508414 + if (destinationCalendar && !Object.isFrozen(destinationCalendar)) { destinationCalendar.primaryEmail = primary.email; destinationCalendar.integrationTitle = integration.title; + destinationCalendar = Object.freeze(destinationCalendar); } return {