From 9600ab608568ee1341657302afae548641202c03 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:11:36 +0530 Subject: [PATCH] fix: Add to calendar feature not working properly (#20515) --- .../routers/loggedInViewer/setDestinationCalendar.handler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts b/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts index 344f456b99..9f7e42bf4c 100644 --- a/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts +++ b/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts @@ -81,7 +81,8 @@ export const setDestinationCalendarHandler = async ({ ctx, input }: SetDestinati allCals.find( (cal) => cal.primary && - (cal.credentialId === credentialId || cal.delegationCredentialId === delegationCredentialId) + (cal.credentialId === credentialId || + (!!cal.delegationCredentialId && cal.delegationCredentialId === delegationCredentialId)) )?.email ?? null; if (eventTypeId) {