Speedup agenda

This commit is contained in:
Peter Maquiran
2021-07-13 09:57:38 +01:00
parent 3f1f785283
commit ff00f6014b
3 changed files with 38 additions and 45 deletions
+7 -18
View File
@@ -190,14 +190,17 @@ export class AgendaPage implements OnInit {
const pathname = window.location.pathname
let rrealoadCounter = 0
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == "/home/agenda") {
if(event instanceof NavigationEnd && event.url == pathname ) {
if (this.segment == null){
this.segment = "Combinado";
}
else{
else if ( rrealoadCounter != 0) {
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
rrealoadCounter++;
}
}
});
@@ -336,7 +339,6 @@ export class AgendaPage implements OnInit {
// for timeline
get CalendarCurrentDay ():any {
/* console.log(this.viewDate.getDate(), '0_0') */
@@ -460,6 +462,8 @@ export class AgendaPage implements OnInit {
}
loadRangeEvents(startTime: Date, endTime: Date){
console.log('==========================================================')
this.eventSelectedDate = new Date(startTime);
@@ -774,9 +778,6 @@ export class AgendaPage implements OnInit {
}
} else {
//this.showTimelinePR = false;
//this.showTimelineMD = false;
// calendar
let counter = 0;
@@ -834,12 +835,6 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
}
}).finally(() =>{
counter++;
if(counter==2) {
this.showLoader = false;
}
})
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
@@ -887,12 +882,6 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
}
}).finally(() =>{
counter++;
if(counter==2) {
this.showLoader = false;
}
})