only create event on first calendar integration (#1155)

* only create event on first calendar integration

* fix it

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/1165/head^2
Alex Johansson 2021-11-11 06:50:56 +01:00 committed by GitHub
parent bf659c0b16
commit d4f8030b6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -213,10 +213,15 @@ export default class EventManager {
* @private
*/
private createAllCalendarEvents(event: CalendarEvent, noMail: boolean | null): Promise<Array<EventResult>> {
return async.mapLimit(this.calendarCredentials, 5, async (credential: Credential) => {
return createEvent(credential, event, noMail);
});
private async createAllCalendarEvents(
event: CalendarEvent,
noMail: boolean | null
): Promise<Array<EventResult>> {
const [firstCalendar] = this.calendarCredentials;
if (!firstCalendar) {
return [];
}
return [await createEvent(firstCalendar, event, noMail)];
}
/**