-
Notifications
You must be signed in to change notification settings - Fork 192
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
Redirect to sub-route in same group does not trigger reactive update of .getRouteName() #314
Comments
Could you send me that sample repo? |
I experienced the same problem as @derwaldgeist. The problem was that I think I could fix it. I'll add a pull request. |
Hey, that sounds great. Was out of office the last days and did not find the time to create a test repo. Le'ts see if it's still necessary. |
@mbernath That's great. Looking forward to that. |
Here you go! That change fixes the bug for me... |
Hmmm... The change seems to break the tests. (Sorry I couldn't run them locally - didn't work) I've added a check if |
No. Just update your branch with the new code.
|
Thanks! I see the tests pass now... |
Hey, release a new version for this issue in |
@arunoda: Thank you! I checked and I can confirm that it works for me :-) |
Great. |
I can also confirm it is working now. Great, thanks a lot! |
Scenario:
I have set up a group route containing a teaser page at /group and a hidden page at /group/page. The idea is to show the teaser page if the user is not logged in, and replace it by the hidden page the user has logged in. Here is my route configuration for this:
I am also using a navigation bar with two nav items: one for the app home (called root, with route path /) and a second item for the group route, which shall be highlighted for for both /group and /group/page. I am using
zimme:meteor-activeroute
to do this, with this configuration:The switch between the nav items works fine if the user is not logged in. However, once the user is logged in, clicking on the second nav item will not cause a switch of the nav item highlight (i.e. the isActiveRoute helpers won't update). After debugging and writing FlowRouter's route state to the console, I found out that FlowRouter's reactive functions like .getRouteName() won't reactively update if a redirect to a sub-route of a route group takes place. The reactive updates only work if the redirect target is the root of the route group. I tested this by placing a dummy helper in my template that just reports .getRouteName() to the console.
The text was updated successfully, but these errors were encountered: