Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
name: this.state.calendars.find(
cal => cal.accessLevel === Calendar.CalendarAccessLevel.OWNER
).source.name,
isLocalAccount: true,
}
: undefined,
name: 'coolNewCalendar',
accessLevel: Calendar.CalendarAccessLevel.OWNER,
ownerAccount:
Platform.OS === 'android'
? this.state.calendars.find(cal => cal.accessLevel === Calendar.CalendarAccessLevel.OWNER)
.ownerAccount
: undefined,
};
try {
await Calendar.createCalendarAsync(newCalendar);
Alert.alert('Calendar saved successfully');
this._findCalendars();
} catch (e) {
Alert.alert('Calendar not saved successfully', e.message);
}
}