The first time we enter a route with CMS-driven child routes, say /store-finder, the page data are loaded.
But when we navigate out to homepage and then again back to /store-finder, the call for page data is not made. This is inconsistent with all other pages which make call for page data whenever the route is visited again.
The cause of the problem with store finder is that dynamically created route for /store-finder doesn't have CmsRouteGuard. However simply adding it will cause calling backend twice at the first time we open this route - which is not acceptable.
The solution can be:
adding some meta flag in data of this dynamically added route
adding new DynamicCmsRouteGuard to this route - which check the flag wheter the route is first time visited. If yes, it turns off the flag and doesn't call backend. Every next time when it checks flag, its turned off, so it calls regular CmsPageGuard.canActivate under the hood.
The first time we enter a route with CMS-driven child routes, say
/store-finder
, the page data are loaded.But when we navigate out to homepage and then again back to
/store-finder
, the call for page data is not made. This is inconsistent with all other pages which make call for page data whenever the route is visited again.The cause of the problem with store finder is that dynamically created route for
/store-finder
doesn't haveCmsRouteGuard
. However simply adding it will cause calling backend twice at the first time we open this route - which is not acceptable.The solution can be:
data
of this dynamically added routeCmsPageGuard.canActivate
under the hood.~Blocked by https://github.com/SAP/cloud-commerce-spartacus-storefront/issues/1656~