Route conditions not evaluated in RouterCtl#set
See original GitHub issueI added condition to my route
(staticRoute("/profile", ProfilePage) ~> renderR(ctl => Profile(ctl))) .addCondition(grantPrivateAccess)(_ => redirectToPage(Home)(Redirect.Push))
When i use <a href="/profile">
or window.location.href = "/profile"
it works,
but when I use methods of RouterCtl (set(ProfilePage)
) condition grantPrivateAccess
isn`t checked and it goes to ProfilePage
How can I fix it ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Two static routes to same destination in routing table possible?
But both needs to be in routing table. Floating routes does not work because route with higher admin distance does not inserted into...
Read more >Troubleshooting BGP Neighbor Adjacency
BGP Neighbor Adjacency issues occur every now and then, this lesson explains the most common issues and how to fix them.
Read more >How Routing Information Protocol (RIP) works - TechTarget
If a router receives an update on a route, and the new path is shorter, it will update its table entry with the...
Read more >Example: Forwarding Packets to the Discard Interface
The requests are sent to a router that does not forward the packets. The problematic routes are sometimes referred to as discard routes...
Read more >SAP Cloud Integration - Define Router - SAP Help Portal
We recommend that you ensure that the routing branches of a router are configured with the same type of condition, either XML or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You’ve got impure code outside of
Callback
; side-effects must be captured insideCallback
. To be specific,localStorage
(just like a global variable) isn’t referentially-transparent and is the problem here.Try changing
to this:
As a temporary hack, you could use
RouterCtl#contramap
to workaround this. So something like: