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 { NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';
@Component({
selector: 'app-despachos',
@@ -62,10 +62,15 @@ export class DespachosPage implements OnInit {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList();
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
this.LoadList();
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing()
} else {
this.LoadList()
}
}
});
@@ -74,7 +79,7 @@ export class DespachosPage implements OnInit {
async refreshing() {
setTimeout(() => {
this.LoadList();
}, 1500);
}, 1000);
}
segmentChanged(ev: any) {