diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index e4fb79e1d..0d14e613f 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -245,10 +245,13 @@ export class AgendaPage implements OnInit { this.weekToShow() this.eventService.registerOnLoadCalendars(()=> { + this.setCalendarByDefault(true) const selectedCalendarIds = this.getSelectedAgendaCalendars(); this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds) + this.reloadCalendar() + this.tigerUpdate() }) } @@ -773,8 +776,8 @@ export class AgendaPage implements OnInit { updateEventListBox() { - const selectedCalendarIds = this.getSelectedAgendaCalendars(); - this.listToPresent = this.removeDuplicatesByOwnerUserId(this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)) + const selectedCalendarIds = this.removeDuplicatesByOwnerUserId(this.getSelectedAgendaCalendars()); + this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds) console.log('this.listToPresent', JSON.stringify(this.listToPresent) ) const year = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index 94c0f4a2e..fc261c5a0 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -281,7 +281,7 @@ export class EventsService { } this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName] = true - this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName+'Id'] = OwnerCalendar.CalendarId + this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName+'Id'] = OwnerCalendar.OwnerUserId || SessionStore.user.UserId this.calendarNamesType['Meu calendario']['RoleId'] = OwnerCalendar.CalendarRoleId this.calendarNamesType['Meu calendario']['OwnerId'] = OwnerCalendar.OwnerUserId || SessionStore.user.UserId this.calendarNamesType['Meu calendario']['FullName'] = SessionStore.user.FullName @@ -316,7 +316,7 @@ export class EventsService { } this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true - this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId + this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.OwnerUserId this.calendarNamesType[e.FullName]['RoleId'] = sharedCalendar.CalendarRoleId this.calendarNamesType[e.FullName]['OwnerId'] = sharedCalendar.OwnerUserId this.calendarNamesType[e.FullName]['Shared'] = sharedCalendar.OwnerUserId diff --git a/src/app/store/calendar.service.ts b/src/app/store/calendar.service.ts index 42231d08e..d1b0014c2 100644 --- a/src/app/store/calendar.service.ts +++ b/src/app/store/calendar.service.ts @@ -80,23 +80,16 @@ export class CalendarService { let news = [] eventsList.forEach((element, eventIndex) => { - const found = this._eventSource.find( e => e.id == element.EventId) - - if(!found) { - news.push({ - startTime: new Date(element.StartDate), - endTime: new Date(element.EndDate), - allDay: false, - event: element, - calendarName: element.CalendarName, - profile: profile, - id: element.EventId, - CalendarId: CalendarId - }); - } else { - console.log('found') - } - + news.push({ + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + calendarName: element.CalendarName, + profile: profile, + id: element.EventId, + CalendarId: CalendarId + }); });