aboutsummaryrefslogtreecommitdiff
path: root/client/src/View/Payment/Add.hs
diff options
context:
space:
mode:
authorJoris2019-08-10 15:29:56 +0200
committerJoris2019-08-10 15:29:56 +0200
commitc5c54722f4736108c8418c9865f81f05a6db560d (patch)
treef79f5464536d2453a18ffb01bb29cc5cc6f811fa /client/src/View/Payment/Add.hs
parent234b5b29361734656dc780148309962f932d9907 (diff)
downloadbudget-c5c54722f4736108c8418c9865f81f05a6db560d.tar.gz
budget-c5c54722f4736108c8418c9865f81f05a6db560d.tar.bz2
budget-c5c54722f4736108c8418c9865f81f05a6db560d.zip
Fix payment add frequency to the one selected in the page
Diffstat (limited to 'client/src/View/Payment/Add.hs')
-rw-r--r--client/src/View/Payment/Add.hs15
1 files changed, 3 insertions, 12 deletions
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