enso-ui / ui

Laravel Enso UI
MIT License
9 stars 10 forks source link

added check for having the route in the state obj #89

Closed gandesc closed 2 years ago

gandesc commented 2 years ago

we sometimes encounter this error

Cannot read properties of undefined (reading 'name')

when a user clears his browser's cache (and probably in other, harder to reproduce, scenarios as well) and then tries to navigate within the app.

image

Added a simple check to make sure we have the route object in state.

Did not use ?. since this is more explicit as well as didn't want to add the file to the list of explicitly transpiled files.