I have a strange behavior that I’m not sure where else to turn to.
I noticed that when I clicked on a link to a new page/route within the app and the current page/route is not fully loaded, that it won’t fully take me to that page.
Logging indicates that it takes me to the page, but continues firing from the original page, and I don’t know if this is intended behavior?
It’s within a promise, so I’m wondering if this is the reason?
Basically, I am loading a customer with a promise, and then I clicked on the Search button to take me to the search page, because I realized I needed something else to look at.
When I did this, it took me to the search page, but continued firing from the promise, and loaded up parts of the customer page/route within the search page.
I’m unsure how to track for this and correct the behavior.
Right now, I have some basic code on the router:navigation:complete
event to try to help, but it’s not helping.
Here’s the code:
`
this.consolEvent = this.ea.subscribe(‘router:navigation:complete’, async event => {
this.busy.off();
var isSearch = document.location.href;
if (isSearch.match('customer'))
{
var newUrl = isSearch.replace(/\d+$/, this.debtor_id);
if (this.dbtr)
{
this.consolidations = [];
if (this.dbtr.report_as)
{
this.consolidations = await this.getConsolidations(this.dbtr.debtor_id);
this.consolidationsLoaded = 1;
}
}
if (this.state.searchObj.wlTypeRadio == 'invoice')
{
this.state.searchObj.newSearch = 0;
this.state.searchObj.debtor_id = this.debtor_id;
this.state.searchObj.invoice = params.invoice_number;
}
else if (this.state.searchObj.debtorIds)
{
this.state.searchObj.newSearch = 0;
}
}
else if (isSearch.match('search'))
{
console.log('to search');
this.router.navigateToRoute('search');
}
});
`
Any tips or thoughts appreciated.