Add refresh and improve performance

This commit is contained in:
Peter Maquiran
2021-07-16 12:59:43 +01:00
parent 7b93dbf1e2
commit 9f28fc1b03
21 changed files with 186 additions and 123 deletions
@@ -41,15 +41,16 @@ export class PendentesPage implements OnInit {
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
this.LoadList();
// update list
const location = window.location
const pathname = location.pathname + location.search
const pathname = window.location.pathname
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
this.LoadList();
}
});
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
this.LoadList();
}
});
}
segmentChanged(ev: any) {
@@ -63,9 +64,10 @@ export class PendentesPage implements OnInit {
async LoadList(){
this.skeletonLoader = true;
this.pendentesList = new Array();
let pendentes = await this.processes.GetPendingTasks(false).toPromise();
this.pendentesList = new Array();
pendentes.forEach(element => {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);