From 28f5e3091b48aa55331f95d4213910e6d48dee1c Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Thu, 11 Apr 2024 09:45:47 +0200 Subject: [PATCH] Automatically close the menu when changing page. --- src/App/Page/Navigation.purs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App/Page/Navigation.purs b/src/App/Page/Navigation.purs index 9fec7d3..ad0a07d 100644 --- a/src/App/Page/Navigation.purs +++ b/src/App/Page/Navigation.purs @@ -75,7 +75,10 @@ handleAction :: forall m. MonadAff m => Action -> H.HalogenM State Action () Out handleAction = case _ of ToggleMenu -> H.modify_ \state -> state { active = not state.active } -- | Page change. - Navigate page -> H.raise $ Routing page + Navigate page -> do + -- Automatically close the menu. + H.modify_ \state -> state { active = false } + H.raise $ Routing page UnLog -> do H.raise $ Disconnection H.modify_ _ { logged = false }