performance

This commit is contained in:
Peter Maquiran
2023-06-11 20:17:10 +01:00
parent e6fc2f19f2
commit 2688b1e012
37 changed files with 543 additions and 257 deletions
@@ -48,6 +48,13 @@ export class PedidosPage implements OnInit {
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private router: Router,
private processes:ProcessesService,
@@ -61,7 +68,18 @@ export class PedidosPage implements OnInit {
ngOnInit() {
this.router.events.forEach((event) => {
this.LoadList()
this.listSubscription = this.pedidosstore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.dynamicSearch();
this.routerSubscription = this.router.events.subscribe((event) => {
if(event instanceof NavigationStart && '/home/gabinete-digital?parecer=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital?deferimento=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital?pedidos=true'.startsWith(event.url)
@@ -76,11 +94,16 @@ export class PedidosPage implements OnInit {
}
});
this.dynamicSearch()
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) {