Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing state inside frontend controllers causes the on-navigate function run in the wrong order. #633

Open
crimsonhawk47 opened this issue Aug 14, 2023 · 0 comments

Comments

@crimsonhawk47
Copy link

I was trying to put redirects in my controllers based on session state. For instance, if someone navigates to an admin page, they need to be logged in.

I have an on-navigate function like what is shown in the frontend example in controllers.md. Because I'm trying to do redirects, my controllers might use rfe/push-state. But if you call this inside a controller, the on-navigate function gets router matches in reverse order.

So calling in this order: (rfe/push-state :home) -> (rfe/push-state :login) gets matches in the order of /login -> /home.

This leads to an issue where my match atom has the wrong state and the browser has the right state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant