aboutsummaryrefslogtreecommitdiff
path: root/client/src/View/Payment/Pages.hs
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/View/Payment/Pages.hs')
-rw-r--r--client/src/View/Payment/Pages.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/client/src/View/Payment/Pages.hs b/client/src/View/Payment/Pages.hs
index f96cb8e..81555ab 100644
--- a/client/src/View/Payment/Pages.hs
+++ b/client/src/View/Payment/Pages.hs
@@ -1,6 +1,3 @@
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecursiveDo #-}
-
module View.Payment.Pages
( widget
, PagesIn(..)
@@ -11,7 +8,7 @@ import qualified Data.Text as T
import Reflex.Dom (Dynamic, Event, MonadWidget)
import qualified Reflex.Dom as R
-import Common.Model (Payment (..))
+import Common.Model (Frequency (..), Payment (..))
import Component (ButtonIn (..), ButtonOut (..))
import qualified Component as Component
@@ -48,7 +45,8 @@ widget pagesIn = do
{ _pagesOut_currentPage = currentPage
}
- where maxPage = ceiling $ (toRational . length . _pagesIn_payments $ pagesIn) / toRational Constants.paymentsPerPage
+ where paymentCount = length . filter ((==) Punctual . _payment_frequency) . _pagesIn_payments $ pagesIn
+ maxPage = ceiling $ toRational paymentCount / toRational Constants.paymentsPerPage
pageEvent = R.switchPromptlyDyn . fmap R.leftmost
range :: Int -> Int -> [Int]