mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Add refresh and improve performance
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user