slovnicki / beamer

A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation, guards and more.
MIT License
591 stars 129 forks source link

`notFoundRedirectNamed` issue #666

Closed busslina closed 2 months ago

busslina commented 5 months ago

This is not a bug, but a bad behaviour IMO.

On a web browser, when routing to an inexistent route, it gets redirected correctly to notFoundRedirectNamed, but the browser url got stuck with the wrong route. Is there a way to get it changed to the notFoundRedirectNamed value?

Thanks

BeamerDelegate(
        initialPath: initialPath,
        notFoundRedirectNamed: initialPath,
        locationBuilder: RoutesLocationBuilder(
          routes: routes,
        ).call,
        setBrowserTabTitle: true,
        guards: guards,
      )
stan-at-work commented 4 months ago

@busslina So you mean the url on top of the browser does not change when notFoundRedirectNamed is ran ?

The way i see it is to just update the browser title if tghe notFoundRedirectNamedis used?

busslina commented 4 months ago

So you mean the url on top of the browser does not change when notFoundRedirectNamed is ran ?

Exactly.

The way i see it is to just update the browser title if tghe notFoundRedirectNamedis used?

The browser title is working fine.

Also, guard redirections also works fine. It's just the case of a not found route. It gets well redirected but it keeps the inexistent url path on the browser address. It's acting like an alias, which could be cool if any want it, but also it must be provided a way to refresh with the actual path.

stan-at-work commented 4 months ago

So you mean the url on top of the browser does not change when notFoundRedirectNamed is ran ?

Exactly.

The way i see it is to just update the browser title if tghe notFoundRedirectNamedis used?

The browser title is working fine.

Also, guard redirections also works fine. It's just the case of a not found route. It gets well redirected but it keeps the inexistent url path on the browser address. It's acting like an alias, which could be cool if any want it, but also it must be provided a way to refresh with the actual path.

For now you can change it yourself... but it needs to be fixed.

You can do that before you return it with the notFoundRedirectNamed: ...

busslina commented 2 months ago

You can do that before you return it with the notFoundRedirectNamed: ...

But notFoundRedirectNamed is just a String. How can I change there the browser path?

stan-at-work commented 2 months ago

You can do that before you return it with the notFoundRedirectNamed: ...

But notFoundRedirectNamed is just a String. How can I change there the browser path?

Do you want to change the browsor path without changing the app state ?

busslina commented 2 months ago

Seems this issue got resolved "by itself". So I'm closing