diff options
author | Joris | 2019-10-20 21:31:57 +0200 |
---|---|---|
committer | Joris | 2019-10-20 21:31:57 +0200 |
commit | 602c52acfcfa494b07fec05c20b317b60ea8a6f3 (patch) | |
tree | 34fd9c44f82a83569822bc36eb2e0b04518e59f2 /client/src/View/App.hs | |
parent | 7aadcc97f9df0e2daccbe8a8726d8bc6c63d67f4 (diff) |
Load init data per page with AJAX
Diffstat (limited to 'client/src/View/App.hs')
-rw-r--r-- | client/src/View/App.hs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/client/src/View/App.hs b/client/src/View/App.hs index 3292336..b468e56 100644 --- a/client/src/View/App.hs +++ b/client/src/View/App.hs @@ -7,7 +7,8 @@ import Prelude hiding (error, init) import Reflex.Dom (Dynamic, MonadWidget) import qualified Reflex.Dom as R -import Common.Model (Init, InitResult (..)) +import Common.Model (Currency, Init (..), InitResult (..), + UserId) import qualified Common.Msg as Msg import Model.Route (Route (..)) @@ -60,14 +61,19 @@ widget initResult = signedWidget :: MonadWidget t m => Init -> Dynamic t Route -> m () signedWidget init route = do R.dyn . R.ffor route $ \case - RootRoute -> + RootRoute -> do + paymentInit <- Payment.init Payment.view $ PaymentIn - { _paymentIn_init = init + { _paymentIn_currentUser = _init_currentUser init + , _paymentIn_currency = _init_currency init + , _paymentIn_init = paymentInit } - IncomeRoute -> + IncomeRoute -> do + incomeInit <- Income.init Income.view $ IncomeIn - { _incomeIn_init = init + { _incomeIn_currency = _init_currency init + , _incomeIn_init = incomeInit } NotFoundRoute -> |