Very slight code simplification.
parent
dc523d0c5f
commit
e44b1aebe9
|
@ -10,7 +10,7 @@ import App.AuthenticationForm as AF
|
||||||
import App.OriginalInterface as OI
|
import App.OriginalInterface as OI
|
||||||
import Halogen as H
|
import Halogen as H
|
||||||
import Halogen.HTML as HH
|
import Halogen.HTML as HH
|
||||||
import Halogen.HTML.Events as HE
|
-- import Halogen.HTML.Events as HE
|
||||||
import Halogen.HTML.Properties as HP
|
import Halogen.HTML.Properties as HP
|
||||||
import Type.Proxy (Proxy(..))
|
import Type.Proxy (Proxy(..))
|
||||||
import Effect.Aff.Class (class MonadAff)
|
import Effect.Aff.Class (class MonadAff)
|
||||||
|
@ -74,6 +74,7 @@ render state = HH.div_ $
|
||||||
[ HP.class_ (H.ClassName "box") ]
|
[ HP.class_ (H.ClassName "box") ]
|
||||||
[ HH.p_ [ HH.text ("Token is: " <> current_token) ] ]
|
[ HH.p_ [ HH.text ("Token is: " <> current_token) ] ]
|
||||||
|
|
||||||
|
render_original_interface :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad
|
||||||
render_original_interface =
|
render_original_interface =
|
||||||
HH.div
|
HH.div
|
||||||
[ HP.class_ (H.ClassName "box") ]
|
[ 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 :: forall o monad. MonadAff monad => Action -> H.HalogenM State Action ChildSlots o monad Unit
|
||||||
handleAction = case _ of
|
handleAction = case _ of
|
||||||
Authenticated authaction -> case authaction of
|
Authenticated (AF.AuthToken newtoken) -> H.modify_ _ { token = Just newtoken }
|
||||||
AF.AuthToken newtoken -> do
|
|
||||||
-- TODO: do something more.
|
|
||||||
H.modify_ _ { token = Just newtoken }
|
|
||||||
ReadStates -> do
|
ReadStates -> do
|
||||||
{ token } <- H.get
|
{ token } <- H.get
|
||||||
a <- H.request _a unit CA.IsOn
|
a <- H.request _a unit CA.IsOn
|
||||||
|
|
Loading…
Reference in New Issue