@@ -224,14 +224,13 @@ async function handleConnectCalendarCallback (reqQuery) {
224
224
await processCreate ( userMeetingSettings )
225
225
} else { // or just update calendar details in the exisiting object
226
226
const calendarIndexInUserMeetingSettings = _ . findIndex ( userMeetingSettings . nylasCalendars , ( item ) => item . id === calendarDetails . id )
227
-
227
+
228
228
// clone Nylas calendar array and
229
229
// if array item's index doesn't match with calendar index saved in Nylas backend, make it non-primary
230
230
// but if it matches, update the calendar with newer details (which makes it primary too)
231
- let updatedNylasCalendarsArray = _ . map ( Array . from ( userMeetingSettings . nylasCalendars ) , ( item , index ) => {
232
- if ( index !== calendarIndexInUserMeetingSettings )
233
- return { ...item , isPrimary : false }
234
-
231
+ const updatedNylasCalendarsArray = _ . map ( Array . from ( userMeetingSettings . nylasCalendars ) , ( item , index ) => {
232
+ if ( index !== calendarIndexInUserMeetingSettings ) { return { ...item , isPrimary : false } }
233
+
235
234
return { ...item , ...calendarDetails }
236
235
} )
237
236
@@ -286,7 +285,7 @@ async function deleteUserCalendar (currentUser, reqParams) {
286
285
throw new Error ( 'Calendar not found in UserMeetingSettings record.' )
287
286
} else {
288
287
let deletingPrimaryCalendar
289
-
288
+
290
289
// filter all calenders except the one to be deleted and
291
290
// check if deleting calendar is primary
292
291
const remainingCalendars = _ . filter ( userMeetingSettings . nylasCalendars , ( item ) => {
0 commit comments