From c5c54722f4736108c8418c9865f81f05a6db560d Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 10 Aug 2019 15:29:56 +0200 Subject: Fix payment add frequency to the one selected in the page --- client/src/View/Payment/Add.hs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'client/src/View/Payment/Add.hs') diff --git a/client/src/View/Payment/Add.hs b/client/src/View/Payment/Add.hs index bd10e5a..d2d2dc4 100644 --- a/client/src/View/Payment/Add.hs +++ b/client/src/View/Payment/Add.hs @@ -37,6 +37,7 @@ import qualified Util.WaitFor as WaitFor data AddIn t = AddIn { _addIn_categories :: [Category] , _addIn_paymentCategories :: Dynamic t [PaymentCategory] + , _addIn_frequency :: Dynamic t Frequency , _addIn_cancel :: Event t () } @@ -92,16 +93,6 @@ view addIn = do (const currentDay <$> reset) confirm) - frequency <- _selectOut_value <$> (Component.select $ SelectIn - { _selectIn_label = Msg.get Msg.Payment_Frequency - , _selectIn_initialValue = Punctual - , _selectIn_value = R.never - , _selectIn_values = R.constDyn frequencies - , _selectIn_reset = reset - , _selectIn_isValid = const True - , _selectIn_validate = confirm - }) - let setCategory = R.fmapMaybe id . R.updated @@ -122,13 +113,13 @@ view addIn = do c <- cost d <- date cat <- category - f <- frequency + f <- _addIn_frequency addIn return (CreatePayment <$> ValidationUtil.nelError n <*> ValidationUtil.nelError c <*> ValidationUtil.nelError d <*> ValidationUtil.nelError cat - <*> ValidationUtil.nelError f) + <*> V.Success f) (addPayment, cancel, confirm) <- R.divClass "buttons" $ do rec -- cgit v1.2.3