From e44b1aebe9665d8291c44c64586614850601798d Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Fri, 2 Jun 2023 00:27:24 +0200 Subject: [PATCH] Very slight code simplification. --- src/App/Container.purs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/App/Container.purs b/src/App/Container.purs index 52d63a2..5a1eec6 100644 --- a/src/App/Container.purs +++ b/src/App/Container.purs @@ -10,7 +10,7 @@ import App.AuthenticationForm as AF import App.OriginalInterface as OI import Halogen as H import Halogen.HTML as HH -import Halogen.HTML.Events as HE +-- import Halogen.HTML.Events as HE import Halogen.HTML.Properties as HP import Type.Proxy (Proxy(..)) import Effect.Aff.Class (class MonadAff) @@ -74,6 +74,7 @@ render state = HH.div_ $ [ HP.class_ (H.ClassName "box") ] [ HH.p_ [ HH.text ("Token is: " <> current_token) ] ] + render_original_interface :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad render_original_interface = HH.div [ HP.class_ (H.ClassName "box") ] @@ -113,10 +114,7 @@ render state = HH.div_ $ handleAction :: forall o monad. MonadAff monad => Action -> H.HalogenM State Action ChildSlots o monad Unit handleAction = case _ of - Authenticated authaction -> case authaction of - AF.AuthToken newtoken -> do - -- TODO: do something more. - H.modify_ _ { token = Just newtoken } + Authenticated (AF.AuthToken newtoken) -> H.modify_ _ { token = Just newtoken } ReadStates -> do { token } <- H.get a <- H.request _a unit CA.IsOn