This commit is contained in:
Peter Maquiran
2021-07-17 14:02:05 +01:00
parent 133e3ad122
commit b1c165bf87
23 changed files with 240 additions and 142 deletions
@@ -14,7 +14,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { AuthService } from 'src/app/services/auth.service';
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { ActivatedRoute, NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';
@Component({
selector: 'app-despachos',
@@ -67,11 +67,16 @@ export class DespachosPage implements OnInit {
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
this.LoadList();
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd &&
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?despachos=true')) {
this.LoadList();
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
} else {
this.LoadList()
}
}
});
@@ -138,11 +143,11 @@ export class DespachosPage implements OnInit {
}
doRefresh() {
this.LoadList();
setTimeout(() => {
//event.target.complete();
}, 2000);
this.LoadList();
}, 1000);
}
// old