This commit is contained in:
tiago.kayaya
2021-07-06 15:35:51 +01:00
parent c9b191029a
commit e4d05f17b7
4 changed files with 72 additions and 102 deletions
@@ -28,12 +28,7 @@
<div class="main-content">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
<div class="width-100" [ngSwitch]="segment">
@@ -41,7 +41,6 @@ constructor(
ngOnInit() {
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
console.log('Atualiza');
this.refreshing();
}
});
@@ -172,7 +171,8 @@ constructor(
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
this.diplomasList = removeDuplicate( this.diplomasList)
this.diplomasList = removeDuplicate(this.diplomasList);
this.diplomasList = this.sortArrayISODate(this.diplomasList).reverse();
});
this.showLoader = false;
@@ -202,13 +202,20 @@ constructor(
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
this.diplomasList = removeDuplicate( this.diplomasList)
this.diplomasList = removeDuplicate(this.diplomasList);
this.diplomasList = this.sortArrayISODate(this.diplomasList).reverse();
});
this.showLoader = false;
break;
}
}
}
sortArrayISODate(myArray: any) {
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
async refreshing() {
setTimeout(() => {
@@ -431,8 +431,7 @@ export class GabineteDigitalPage implements OnInit {
openDiplomasPage(segment:string) {
if( window.innerWidth <= 801){
/* let navigationExtras: NavigationExtras = { queryParams: {"segment": segment}}; */
this.router.navigate(['/home/gabinete-digital/diplomas']/* , navigationExtras */);
this.router.navigate(['/home/gabinete-digital/diplomas']);
}
else{
this.closeAllDesktopComponents();