diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index b018aac9f..cc02c8c08 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -225,7 +225,6 @@ export class EventsService { } }); - for (let sharedCalendar of this.loggeduser.SharedCalendars) { @@ -252,38 +251,39 @@ export class EventsService { this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName); } + } - for (let sharedCalendar of this.loggeduser.SharedCalendars) { - if(sharedCalendar?.OwnerUserId) { - this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { - this.calendarNames[sharedCalendar.CalendarId] = e.FullName - this.myCalendarNames[sharedCalendar.CalendarId] = e.FullName - if(!this.calendarNamesAry.includes(e.FullName)) { - this.calendarNamesAry.push(e.FullName) - this.calendarNamesType[e.FullName] = {} - } + for (let sharedCalendar of this.loggeduser.SharedCalendars) { + if(sharedCalendar?.OwnerUserId) { + this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { + this.calendarNames[sharedCalendar.CalendarId] = e.FullName + this.myCalendarNames[sharedCalendar.CalendarId] = e.FullName - this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true - this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId - - }) - } - + if(!this.calendarNamesAry.includes(e.FullName)) { + this.calendarNamesAry.push(e.FullName) + this.calendarNamesType[e.FullName] = {} + } + + this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true + this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId + + }) + } + + } + + for (let sharedCalendar of this.loggeduser.OwnerCalendars) { + + this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario' + + if(!this.calendarNamesAry.includes('Meu calendario')) { + this.calendarNamesAry.push('Meu calendario') + this.calendarNamesType['Meu calendario'] = {} } - for (let sharedCalendar of this.loggeduser.OwnerCalendars) { - - this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario' - - if(!this.calendarNamesAry.includes('Meu calendario')) { - this.calendarNamesAry.push('Meu calendario') - this.calendarNamesType['Meu calendario'] = {} - } - - this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true - this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId - } + this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true + this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId } } } diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index ecec57ed6..16ed46908 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -165,7 +165,7 @@ export class NewEventPage implements OnInit { this.eventBody = { BodyType : "1", Text : ""}; this.postEvent.Body = this.eventBody; - if(this.selectedSegment != "Combinada"){ + if(this.selectedSegment != "Combinada") { this.postEvent ={ EventId: '', Subject: '', @@ -188,7 +188,7 @@ export class NewEventPage implements OnInit { }; } else{ - this.postEvent ={ + this.postEvent = { EventId: '', Subject: '', Body: this.eventBody, @@ -207,11 +207,11 @@ export class NewEventPage implements OnInit { Category: 'Reunião', HasAttachments: false, EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime}, - }; + } } if(this.postEvent.Attendees != null) { - this.postEvent.Attendees.forEach(e =>{ + this.postEvent.Attendees.forEach(e => { if(e.IsRequired) { this.taskParticipants.push(e); } else {