This commit is contained in:
Peter Maquiran
2022-12-21 12:46:10 +01:00
parent 5eb821dd21
commit b646f273f1
2 changed files with 14 additions and 12 deletions
+11 -10
View File
@@ -65,6 +65,9 @@ export class EventsPage implements OnInit {
loggeduser: LoginUserRespose;
sessoStore = SessionStore;
showAgendaLoader = false
showCorrespondenciasLoader = false
constructor(
private eventService: EventsService,
private router: Router,
@@ -107,9 +110,6 @@ export class EventsPage implements OnInit {
ngOnInit() {
this.segment = "Combinada";
this.profile = "mdgpr";
this.showGreeting();
this.router.events.forEach((event) => {
@@ -137,14 +137,13 @@ export class EventsPage implements OnInit {
}
}
doRefresh(event) {
doRefresh() {
this.RefreshEvents();
this.LoadList();
event.target.complete();
}
onSegmentChange() {
this.RefreshEvents();
this.doRefresh();
}
@@ -152,19 +151,21 @@ export class EventsPage implements OnInit {
this.currentEvent = "";
this.showLoader = true;
this.showAgendaLoader = true;
let date = new Date();
let month = date.getMonth() + 1;
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
if(SessionStore.user) {
console.log('im here')
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
this.showAgendaLoader = false;
console.error(error)
})
this.listToPresent = onwEvent;
this.totalEvent = onwEvent.length;
this.showLoader = false;
this.showAgendaLoader = false;
} else {
}
@@ -401,18 +402,18 @@ export class EventsPage implements OnInit {
}
LoadList() {
this.showCorrespondenciasLoader = true
this.processes.GetTaskListExpediente(false).subscribe(result => {
//
this.addProcessToDb(result);
let ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
this.listToPresentexpediente = ExpedienteTask;
this.showLoader = false;
this.showCorrespondenciasLoader = false
}, ((error) => {
this.showLoader = false;
this.showCorrespondenciasLoader = false
//
this.getEventsFromLocalDb();
}));