mercredi 15 avril 2020

Issues with model when navigating while still being retrieved

Working with an older ember application (2.18.1). The following problem is repeated too many times to all fix in the time frame I got available right now.

The component is loading it's own data (setting this.get('model')) and all works fine.

However as the database is now a little slower the user sometimes click on one link, where the template render the component and it start loading it's data .

If the user click another link (to a route that does exactly the same) data from both the previous and the "new" component get loaded.

I can't reset the model when data get loaded, since the fetchRecord method that loads the data get called over and over with paging (as the user scroll down).

I'm sure I'm just not thinking of an obvious solution (did not work on Ember for a few years), any advise?

(ps: some of these components does not use paging, in mean time I'm going to clear out the model before setting it to what the api returns)




Aucun commentaire:

Enregistrer un commentaire