Browser back button and loading state

Hi.

I’m trying to use loading substate template as described here https://guides.emberjs.com/v2.4.0/routing/loading-and-error-substates/

After user has clicked a link, this substate template is shown until model hook is being resolved. But if user clicks browser Back button while template is on screen, he transitions to the wrong route, because loading substate doesn’t create a browser history record.

How can I get around this default behaviour and force Ember to stay on the current route when clicking Back button during loading substate route is on screen?

1 Like