Closed iamcsharper closed 1 year ago
You can change the hide function to something like ctx => !isOrderSuccessful(ctx)
or ctx => !didOrderFail(ctx)
or something like that. But I think multiple menus with their own MenuMiddleware each seems more fitting here.
You can have the main menu on /
and add another MenuMiddleware for ordererror/
and orderdone/
. I am currently not sure about the do function return path as its a different middleware then. But orderSuccessfulMiddleware.replyToContext(ctx)
will work for sure.
Hope this helps?
Thanks for the reply!
Describe the bug When you add a submenu (path /typ) to root menu, and set
hide: () => true
, you cannot navigate to the path /typfrom anywhere else via otherMenu.navigate('Click', '/typ')I need this case to implement scenario:
I have to process the click and navigate the user at the same time, that's why .submenu is not suitable for me. Besides, I will have other code parts that will navigate the user to the "thank you page" menu, that's why I can't make the POST request IN the "thank you page" menu "render" function
I also tried the
resendMenuToContext
function, but it looks like I can't use any buttons or selects in the menu sent, because it is not registered in the tree and not processed (leads to main menu on any click)Versions
Expected behavior I expect it to be controllable via options or middlewares, should the router ignore a path if its hidden, OR to have a "async do" option in submenu